Compare commits

..
Author SHA1 Message Date
John Colvin 9fbf84eeb7 fix (ui): Change qty to double in Manual Fills Import dialog 2025-08-18 12:11:22 -05:00
John Colvin 0bea6e223a fix (ui): Show decimal places in Manual Fills Qty column 2025-08-18 12:11:22 -05:00
John Colvin 005207e061 refactor: Expose price/qty display settings as Security ext fns
Previously, these display settings were only available via SecurityMD objs.
However, many data sources (e.g., orders, fills, etc.) are joined with regular
Security objs (not SecurityMD). This saves us from doing awkward joins to get
the SecurityMD to get the display settings.
2025-08-18 12:11:13 -05:00
1417 changed files with 16074 additions and 34381 deletions

No files matched your search

-6
View File
@@ -25,12 +25,6 @@
"commands": [ "commands": [
"fake" "fake"
] ]
},
"dotnet-t4": {
"version": "3.0.0",
"commands": [
"t4"
]
} }
} }
} }
@@ -55,16 +55,14 @@ RUN \
clangd-$clang_major clangd-$clang_major
# CMake # CMake
RUN set -eux \ RUN \
&& apt-get update \ curl -fsSL https://apt.kitware.com/keys/kitware-archive-latest.asc 2> /dev/null \
&& apt-get install -y --no-install-recommends ca-certificates curl gpg \ | gpg --dearmor - \
&& curl -fsSL https://apt.kitware.com/keys/kitware-archive-latest.asc \ | tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null \
| gpg --dearmor -o /usr/share/keyrings/kitware-archive-keyring.gpg \ && echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \ | tee /etc/apt/sources.list.d/kitware.list > /dev/null \
> /etc/apt/sources.list.d/kitware.list \ && apt-get update \
&& apt-get update \ && apt-get install -y cmake
&& apt-get install -y --no-install-recommends cmake \
&& rm -rf /var/lib/apt/lists/*
# Dotnet # Dotnet
RUN apt-get update && apt-get install -y dotnet8 RUN apt-get update && apt-get install -y dotnet8
@@ -82,14 +80,9 @@ RUN mkdir -p /etc/apt/keyrings \
# Emumba (deps) # Emumba (deps)
RUN apt-get update && apt-get -y install rapidjson-dev RUN apt-get update && apt-get -y install rapidjson-dev
# Emumba # Emumba
ARG EMUMBA_DERIBIT_CONNECTOR_DEB_URL="https://api.bitbucket.org/2.0/repositories/bluetradesys/spark/downloads/emumba-deribit-connector-3.3.1-Linux.LICENSE_DISABLED.deb" COPY emumba /emumba
RUN --mount=type=secret,id=bitbucket_access_token \ RUN dpkg -i /emumba/emumba-deribit-connector-3.3.1-Linux.LICENSE_DISABLED.deb \
set -eux \ && rm -r /emumba
&& apt-get update \
&& TOKEN="$(cat /run/secrets/bitbucket_access_token)" \
&& curl -fL -H "Authorization: Bearer ${TOKEN}" $EMUMBA_DERIBIT_CONNECTOR_DEB_URL -o /tmp/emumba-deribit-connector.deb \
&& apt-get install -y /tmp/emumba-deribit-connector.deb \
&& rm -f /tmp/emumba-deribit-connector.deb
# Pcap # Pcap
RUN apt-get update && apt-get install -y libpcap0.8-dev RUN apt-get update && apt-get install -y libpcap0.8-dev
@@ -97,18 +90,6 @@ RUN apt-get update && apt-get install -y libpcap0.8-dev
# Databento (deps) # Databento (deps)
RUN apt-get update && apt-get -y install libzstd-dev RUN apt-get update && apt-get -y install libzstd-dev
# Rakurai
ARG RAKURAI_DEB_URL="https://api.bitbucket.org/2.0/repositories/bluetradesys/spark/downloads/rakurai-dex-connector_0.0.5_amd64.deb"
RUN --mount=type=secret,id=bitbucket_access_token \
set -eux \
&& apt-get update \
&& TOKEN="$(cat /run/secrets/bitbucket_access_token)" \
&& curl -fL -H "Authorization: Bearer ${TOKEN}" $RAKURAI_DEB_URL -o /tmp/rakurai.deb \
# Need --force-overwrite because rakuirai and emumba-deribit-connector both include the same
# spdlog headers.
&& apt-get install -y -o Dpkg::Options::="--force-overwrite" /tmp/rakurai.deb \
&& rm -f /tmp/rakuirai.deb
# Docker in Docker # Docker in Docker
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
docker.io \ docker.io \
+1 -7
View File
@@ -1,11 +1,5 @@
{ {
"build": { "dockerFile": "Dockerfile",
"dockerfile": "../docker/images/bluetradingsystems/linux_dotnet8_dev/Dockerfile",
"options": [
"--secret",
"id=bitbucket_access_token,src=${localWorkspaceFolder}/.secrets/bitbucket_access_token.txt"
]
},
"hostRequirements": { "hostRequirements": {
"memory": "8gb", "memory": "8gb",
"storage": "10gb" "storage": "10gb"
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
this_dir="$(realpath "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
sudo dpkg -i "$this_dir/emumba-deribit-connector-3.3.1-Linux.LICENSE_DISABLED.deb"
+16 -30
View File
@@ -207,23 +207,17 @@ dotnet_naming_symbols.parameters.applicable_accessibilities = public,internal,pr
dotnet_naming_symbols.private_symbols.applicable_kinds = property,method,field,event,delegate dotnet_naming_symbols.private_symbols.applicable_kinds = property,method,field,event,delegate
dotnet_naming_symbols.private_symbols.applicable_accessibilities = protected,private dotnet_naming_symbols.private_symbols.applicable_accessibilities = protected,private
# local symbols
dotnet_naming_symbols.local_symbols.applicable_kinds = local
# parameter symbols
dotnet_naming_symbols.parameter_symbols.applicable_kinds = parameter
# Naming styles # Naming styles
dotnet_naming_style.pascal_case.required_prefix = dotnet_naming_style.snake_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix = dotnet_naming_style.snake_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator = dotnet_naming_style.snake_case.word_separator = _
dotnet_naming_style.pascal_case.capitalization = pascal_case dotnet_naming_style.snake_case.capitalization = all_lower
dotnet_naming_style.camel_case.required_prefix = dotnet_naming_style.private_snake_case.required_prefix = _
dotnet_naming_style.camel_case.required_suffix = dotnet_naming_style.private_snake_case.required_suffix =
dotnet_naming_style.camel_case.word_separator = dotnet_naming_style.private_snake_case.word_separator = _
dotnet_naming_style.camel_case.capitalization = camel_case dotnet_naming_style.private_snake_case.capitalization = all_lower
dotnet_naming_style.user_types.required_prefix = dotnet_naming_style.user_types.required_prefix =
dotnet_naming_style.user_types.required_suffix = dotnet_naming_style.user_types.required_suffix =
@@ -235,10 +229,6 @@ dotnet_naming_style.interface.required_suffix =
dotnet_naming_style.interface.word_separator = dotnet_naming_style.interface.word_separator =
dotnet_naming_style.interface.capitalization = pascal_case dotnet_naming_style.interface.capitalization = pascal_case
dotnet_naming_style.local.capitalization = camel_case
dotnet_naming_style.parameter.capitalization = camel_case
# rules # rules
dotnet_naming_rule.user_types.symbols = user_types dotnet_naming_rule.user_types.symbols = user_types
dotnet_naming_rule.user_types.style = user_types dotnet_naming_rule.user_types.style = user_types
@@ -248,18 +238,14 @@ dotnet_naming_rule.interfaces.symbols = interface
dotnet_naming_rule.interfaces.style = interface_style dotnet_naming_rule.interfaces.style = interface_style
dotnet_naming_rule.interfaces.severity = suggestion dotnet_naming_rule.interfaces.severity = suggestion
dotnet_naming_rule.public_members.symbols = public_symbols dotnet_naming_rule.public_members_snake_case.symbols = public_symbols
dotnet_naming_rule.public_members.style = pascal_case dotnet_naming_rule.public_members_snake_case.style = snake_case
dotnet_naming_rule.public_members.severity = suggestion dotnet_naming_rule.public_members_snake_case.severity = suggestion
dotnet_naming_rule.private_members.symbols = private_symbols dotnet_naming_rule.private_members_snake_case.symbols = private_symbols
dotnet_naming_rule.private_members.style = camel_case dotnet_naming_rule.private_members_snake_case.style = private_snake_case
dotnet_naming_rule.private_members.severity = suggestion dotnet_naming_rule.private_members_snake_case.severity = suggestion
dotnet_naming_rule.variables_are_camel_case.severity = suggestion dotnet_naming_rule.parameters.symbols = parameters
dotnet_naming_rule.variables_are_camel_case.symbols = local_symbols dotnet_naming_rule.parameters.style = snake_case
dotnet_naming_rule.variables_are_camel_case.style = local
dotnet_naming_rule.parameters.symbols = parameter_symbols
dotnet_naming_rule.parameters.style = parameter
dotnet_naming_rule.parameters.severity = suggestion dotnet_naming_rule.parameters.severity = suggestion
-15
View File
@@ -29,9 +29,6 @@
# tools/deploy.sh --help # tools/deploy.sh --help
# #
### Host/Runtime ###
TZ=Etc/UTC
### Sparkd ### ### Sparkd ###
# The internal image for sparkd to use. For more info, view: # The internal image for sparkd to use. For more info, view:
# src/server/sparkd/Dockerfile # src/server/sparkd/Dockerfile
@@ -41,9 +38,6 @@ SPARKD__CONFIG_DIR=src/app_sparkd/configurations/dev
# Mount a specific volume or dir to "~/sparkdata/data" inside the docker. # Mount a specific volume or dir to "~/sparkdata/data" inside the docker.
# Defaults to a volume named "sparkd_<config_port>" (e.g., sparkd_8000). # Defaults to a volume named "sparkd_<config_port>" (e.g., sparkd_8000).
# SPARKD__DATA_DIR=/home/bts/sparkdata/data # SPARKD__DATA_DIR=/home/bts/sparkdata/data
# Mount volume or dir to "/md_recording" inside the docker. Defaults to volume
# "sparkd_md_recording_<config_port>" (e.g., sparkd_md_recording_8000).
# SPARKD__MD_RECORDING_DIR=/home/bts/md_recording
SPARKD__SOURCE_DIR=install/sparkd-release-gcc SPARKD__SOURCE_DIR=install/sparkd-release-gcc
SPARKD__RUNTIME_CONF_DIR=/home/ubuntu/8000/sparkdata/conf/ SPARKD__RUNTIME_CONF_DIR=/home/ubuntu/8000/sparkdata/conf/
SPARKD__CONFIG_PORT=8000 SPARKD__CONFIG_PORT=8000
@@ -51,14 +45,5 @@ SPARKD__QUICKBUS_PORT=8001
SPARKD__SIM_FIX_PORT=8002 SPARKD__SIM_FIX_PORT=8002
SPARKD__SHM_SIZE=4gb SPARKD__SHM_SIZE=4gb
SPARKD__PYTHON_REQUIREMENTS=requirements.txt SPARKD__PYTHON_REQUIREMENTS=requirements.txt
SPARKD__SPARKD_ENTRYPOINT=src/app_sparkd/sparkd-entrypoint.sh
SPARKD__MAIN_ENTRYPOINT=./sparkd-entrypoint.sh
### PubSubServer ###
PUBSUB__CONFIG_DIR=src/DataStreamSuite/PubSubServer/Configurations/Development
PUBSUB__SOURCE_DIR=build/Release/bin/net8.0/linux-x64/publish
### MdPublisher ###
MD_PUBLISHER__CONFIG_DIR=src/DataStreamSuite/DataStreamPublisher/Configurations/ReplayMarketData
MD_PUBLISHER__SOURCE_DIR=build/Release/bin/net8.0/linux-x64/publish
# TODO: add config for other services (pubsub, md-publisher, webapp, api-server, etc.) # TODO: add config for other services (pubsub, md-publisher, webapp, api-server, etc.)
-2
View File
@@ -55,8 +55,6 @@ trace_data/
.cache/ .cache/
/src/Spark.Admin.WebApp/tsconfig.*.g.json /src/Spark.Admin.WebApp/tsconfig.*.g.json
/src/Spark.Admin.WebApp/src/bin/ /src/Spark.Admin.WebApp/src/bin/
/src/**/*appsettings.Local.json
/src/**/*/Configurations/Local/
**/CMakeDeps.cmake **/CMakeDeps.cmake
**/CMakeDeps_win.cmake **/CMakeDeps_win.cmake
.devcontainer/ .devcontainer/
+19 -225
View File
@@ -14,49 +14,6 @@
"type": "coreclr", "type": "coreclr",
"request": "attach" "request": "attach"
}, },
{
"name": "Api Server",
"type": "coreclr",
"request": "launch",
"program": "",
"preLaunchTask": "Build Api Server (Debug)",
"windows": {
"program": "spark_api_server.exe",
},
"linux": {
"program": "spark_api_server",
},
"args": [
"run",
],
"cwd": "build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:apiServerEnvironment}",
},
"stopAtEntry": false,
"console": "integratedTerminal"
},
{
"name": "Api Server (Skip Build)",
"type": "coreclr",
"request": "launch",
"program": "",
"windows": {
"program": "spark_api_server.exe",
},
"linux": {
"program": "spark_api_server",
},
"args": [
"run",
],
"cwd": "build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:apiServerEnvironment}",
},
"stopAtEntry": false,
"console": "integratedTerminal"
},
{ {
"name": "DataStreamPublisher", "name": "DataStreamPublisher",
"type": "coreclr", "type": "coreclr",
@@ -69,28 +26,11 @@
"windows": { "windows": {
"program": "DataStreamPublisher.exe", "program": "DataStreamPublisher.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json"
],
"cwd": "build/Debug/bin/net8.0", "cwd": "build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}",
},
"stopAtEntry": false,
"console": "integratedTerminal"
},
{
"name": "DataStreamPublisher (Skip Build)",
"type": "coreclr",
"request": "launch",
"program": "",
"linux": {
"program": "DataStreamPublisher",
},
"windows": {
"program": "DataStreamPublisher.exe",
},
"cwd": "${workspaceFolder}/build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}",
},
"stopAtEntry": false, "stopAtEntry": false,
"console": "integratedTerminal" "console": "integratedTerminal"
}, },
@@ -142,30 +82,17 @@
"name": "DataStreamQueryAnalyzer", "name": "DataStreamQueryAnalyzer",
"type": "coreclr", "type": "coreclr",
"request": "launch", "request": "launch",
"preLaunchTask": "Build DataStream (Debug)", //"preLaunchTask": "Build DataStreamQueryAnalyzer (Debug)",
"program": "", "program": "",
"windows": { "windows": {
"program": "DataStreamQueryAnalyzer.exe", "program": "DataStreamQueryAnalyzer.exe",
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/DataStreamQueryAnalyzer/Configurations/DataStreamQueryAnalyzer.json"
],
"cwd": "build/Debug/bin/net8.0-windows", "cwd": "build/Debug/bin/net8.0-windows",
"env": { "env": {
"PYTHON_EXE": "${workspaceFolder}/.venv/Scripts/python.exe", "PYTHON_EXE": "${workspaceFolder}/.venv/Scripts/python.exe"
"DOTNET_ENVIRONMENT": "${input:dataStreamQueryAnalyzerEnvironment}",
},
},
"stopAtEntry": false,
"console": "integratedTerminal",
},
{
"name": "DataStreamQueryAnalyzer (Skip Build)",
"type": "coreclr",
"request": "launch",
"program": "",
"windows": {
"program": "DataStreamQueryAnalyzer.exe",
"cwd": "build/Debug/bin/net8.0-windows",
"env": {
"PYTHON_EXE": "${workspaceFolder}/.venv/Scripts/python.exe",
"DOTNET_ENVIRONMENT": "${input:dataStreamQueryAnalyzerEnvironment}",
}, },
}, },
"stopAtEntry": false, "stopAtEntry": false,
@@ -183,65 +110,11 @@
"windows": { "windows": {
"program": "PubSubServer.exe", "program": "PubSubServer.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json"
],
"cwd": "build/Debug/bin/net8.0", "cwd": "build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}",
},
"stopAtEntry": false,
"console": "integratedTerminal"
},
{
"name": "PubSubServer (Skip Build)",
"type": "coreclr",
"request": "launch",
"program": "",
"linux": {
"program": "PubSubServer",
},
"windows": {
"program": "PubSubServer.exe",
},
"cwd": "build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}",
},
"stopAtEntry": false,
"console": "integratedTerminal"
},
{
"name": "Sdk Demo",
"type": "coreclr",
"request": "launch",
"program": "",
"preLaunchTask": "Build Api Server (Debug)",
"windows": {
"program": "Bts.Spark.Sdk.Demo.exe",
},
"linux": {
"program": "Bts.Spark.Sdk.Demo",
},
"cwd": "build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:sdkDemoEnvironment}",
},
"stopAtEntry": false,
"console": "integratedTerminal"
},
{
"name": "Sdk Demo (Skip Build)",
"type": "coreclr",
"request": "launch",
"program": "",
"windows": {
"program": "Bts.Spark.Sdk.Demo.exe",
},
"linux": {
"program": "Bts.Spark.Sdk.Demo.exe",
},
"cwd": "build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:sdkDemoEnvironment}",
},
"stopAtEntry": false, "stopAtEntry": false,
"console": "integratedTerminal" "console": "integratedTerminal"
}, },
@@ -254,9 +127,6 @@
"preLaunchTask": "Build Spark (Debug)", "preLaunchTask": "Build Spark (Debug)",
"program": "Spark.exe", "program": "Spark.exe",
"cwd": "build/Debug/bin/net8.0-windows", "cwd": "build/Debug/bin/net8.0-windows",
"env": {
"DOTNET_ENVIRONMENT": "${input:sparkEnvironment}",
}
}, },
"stopAtEntry": false, "stopAtEntry": false,
"console": "integratedTerminal" "console": "integratedTerminal"
@@ -269,9 +139,6 @@
"windows": { "windows": {
"program": "Spark.exe", "program": "Spark.exe",
"cwd": "build/Debug/bin/net8.0-windows", "cwd": "build/Debug/bin/net8.0-windows",
"env": {
"DOTNET_ENVIRONMENT": "${input:sparkEnvironment}",
}
}, },
"stopAtEntry": false, "stopAtEntry": false,
"console": "integratedTerminal" "console": "integratedTerminal"
@@ -333,7 +200,6 @@
"program": "", "program": "",
"linux": { "linux": {
"program": "${workspaceFolder}/build/sparkd-debug-clang/src/app_sparkd/sparkd", "program": "${workspaceFolder}/build/sparkd-debug-clang/src/app_sparkd/sparkd",
"preLaunchTask": "Build Sparkd (Debug | Clang)",
}, },
"args": [ "args": [
"run" "run"
@@ -383,38 +249,8 @@
} }
] ]
}, },
{
"name": "Sparkd Attach",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceFolder}/build/sparkd-debug-clang/src/app_sparkd/sparkd",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
], ],
"inputs": [ "inputs": [
{
"id": "apiServerEnvironment",
"type": "pickString",
"description": "Api Server Configuration",
"options": [
"Development",
"Local",
"Staging",
],
"default": "Development",
},
{ {
"id": "dataStreamPublisherConfig", "id": "dataStreamPublisherConfig",
"type": "pickString", "type": "pickString",
@@ -428,46 +264,14 @@
"default": "MarketDataPublisher", "default": "MarketDataPublisher",
}, },
{ {
"id": "dataStreamQueryAnalyzerEnvironment", "id": "pubSubServerConfig",
"type": "pickString", "type": "pickString",
"description": "DataStreamQueryAnalyzer Configuration", "description": "PubSub Configuration",
"options": [ "options": [
"Development", "PubSubServer",
"Local", "SimpleEchoClient",
], ],
"default": "Development", "default": "PubSubServer",
},
{
"id": "dataStreamPublisherEnvironment",
"type": "pickString",
"description": "DataStreamPublisher Configuration",
"options": [
"Local",
"ReplayMarketData",
],
"default": "Local",
},
{
"id": "pubSubServerEnvironment",
"type": "pickString",
"description": "PubSubServer Configuration",
"options": [
"Development",
"EchoServer",
"Local",
],
"default": "Development",
},
{
"id": "sdkDemoEnvironment",
"type": "pickString",
"description": "Sdk Demo Configuration",
"options": [
"Development",
"Local",
"Staging",
],
"default": "Development",
}, },
{ {
"id": "sparkConfigServer", "id": "sparkConfigServer",
@@ -475,16 +279,6 @@
"description": "Config Server URL", "description": "Config Server URL",
"default": "http://localhost:8000/config", "default": "http://localhost:8000/config",
}, },
{
"id": "sparkEnvironment",
"type": "pickString",
"description": "Spark Configuration",
"options": [
"Development",
"Local",
],
"default": "Development",
},
{ {
"id": "sparkTest", "id": "sparkTest",
"type": "promptString", "type": "promptString",
+1 -1
View File
@@ -1 +1 @@
PYTHONPATH=/workspaces/spark/build/sparkd-debug-clang/src/lib_python_interop;/workspaces/spark/src/lib_python_interop/python_interop_plugins;/workspaces/spark/tools/py PYTHONPATH=/workspaces/spark/build/sparkd-debug-clang/src/lib_python_interop;/workspaces/spark/src/lib_python_interop/python_interop_plugins
+64 -261
View File
@@ -172,66 +172,6 @@
"color": "terminal.ansiCyan" "color": "terminal.ansiCyan"
}, },
}, },
{
"label": "Build Spark Sdk",
"group": "build",
"type": "process",
"command": "",
"linux": {
"command": "tools/build_spark_sdk.sh",
},
"windows": {
"command": "tools/build_spark_sdk.cmd",
},
"args": [
"--configuration",
"${input:buildConfiguration}",
],
"icon": {
"id": "terminal",
"color": "terminal.ansiCyan"
},
},
{
"label": "Build Spark Sdk (Debug)",
"group": "build",
"type": "process",
"command": "",
"linux": {
"command": "tools/build_spark_sdk.sh",
},
"windows": {
"command": "tools/build_spark_sdk.cmd",
},
"args": [
"--configuration",
"Debug",
],
"icon": {
"id": "terminal",
"color": "terminal.ansiCyan"
},
},
{
"label": "Build Spark Sdk (Release)",
"group": "build",
"type": "process",
"command": "",
"windows": {
"command": "tools/build_spark_sdk.cmd",
},
"linux": {
"command": "tools/build_spark_sdk.sh",
},
"args": [
"--configuration",
"Release",
],
"icon": {
"id": "terminal",
"color": "terminal.ansiCyan"
},
},
{ {
"label": "Build Sparkd", "label": "Build Sparkd",
"group": "build", "group": "build",
@@ -411,129 +351,6 @@
"id": "wrench" "id": "wrench"
}, },
}, },
{
"label": "Run Api Server",
"dependsOn": "Build Api Server",
"type": "process",
"command": "",
"windows": {
"command": "spark_api_server.exe",
},
"linux": {
"command": "spark_api_server",
},
"args": [
"run",
],
"options": {
"cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:apiServerEnvironment}",
}
},
"icon": {
"id": "run",
"color": "terminal.ansiGreen",
},
},
{
"label": "Run Api Server (Debug)",
"dependsOn": "Build Api Server (Debug)",
"type": "process",
"command": "",
"windows": {
"command": "spark_api_server.exe",
},
"linux": {
"command": "spark_api_server",
},
"args": [
"run",
],
"options": {
"cwd": "${workspaceFolder}/build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:apiServerEnvironment}",
}
},
"icon": {
"id": "run",
"color": "terminal.ansiGreen",
},
},
{
"label": "Run Api Server (Release)",
"dependsOn": "Build Api Server (Release)",
"type": "process",
"command": "",
"windows": {
"command": "spark_api_server.exe",
},
"linux": {
"command": "spark_api_server",
},
"args": [
"run",
],
"options": {
"cwd": "${workspaceFolder}/build/Release/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:apiServerEnvironment}",
}
},
"icon": {
"id": "run",
"color": "terminal.ansiGreen",
},
},
{
"label": "Run Api Server (Debug | Skip Build)",
"type": "process",
"command": "",
"windows": {
"command": "spark_api_server.exe",
},
"linux": {
"command": "spark_api_server",
},
"args": [
"run",
],
"options": {
"cwd": "${workspaceFolder}/build/Debug/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:apiServerEnvironment}",
}
},
"icon": {
"id": "run",
"color": "terminal.ansiGreen",
},
},
{
"label": "Run Api Server (Release | Skip Build)",
"type": "process",
"command": "",
"windows": {
"command": "spark_api_server.exe",
},
"linux": {
"command": "spark_api_server",
},
"args": [
"run",
],
"options": {
"cwd": "${workspaceFolder}/build/Release/bin/net8.0",
"env": {
"DOTNET_ENVIRONMENT": "${input:apiServerEnvironment}",
}
},
"icon": {
"id": "run",
"color": "terminal.ansiGreen",
},
},
{ {
"label": "Run DataStreamQueryAnalyzer", "label": "Run DataStreamQueryAnalyzer",
"dependsOn": "Build DataStream", "dependsOn": "Build DataStream",
@@ -541,11 +358,12 @@
"command": "", "command": "",
"windows": { "windows": {
"command": "DataStreamQueryAnalyzer.exe", "command": "DataStreamQueryAnalyzer.exe",
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/DataStreamQueryAnalyzer/Configurations/DataStreamQueryAnalyzer.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0-windows", "cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0-windows"
"env": {
"DOTNET_ENVIRONMENT": "${input:dataStreamQueryAnalyzerEnvironment}",
},
}, },
}, },
"icon": { "icon": {
@@ -560,11 +378,12 @@
"command": "", "command": "",
"windows": { "windows": {
"command": "DataStreamQueryAnalyzer.exe", "command": "DataStreamQueryAnalyzer.exe",
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/DataStreamQueryAnalyzer/Configurations/DataStreamQueryAnalyzer.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/Debug/bin/net8.0-windows", "cwd": "${workspaceFolder}/build/Debug/bin/net8.0-windows"
"env": {
"DOTNET_ENVIRONMENT": "${input:dataStreamQueryAnalyzerEnvironment}",
},
}, },
}, },
"icon": { "icon": {
@@ -579,11 +398,12 @@
"command": "", "command": "",
"windows": { "windows": {
"command": "DataStreamQueryAnalyzer.exe", "command": "DataStreamQueryAnalyzer.exe",
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/DataStreamQueryAnalyzer/Configurations/DataStreamQueryAnalyzer.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/Release/bin/net8.0-windows", "cwd": "${workspaceFolder}/build/Release/bin/net8.0-windows"
"env": {
"DOTNET_ENVIRONMENT": "${input:dataStreamQueryAnalyzerEnvironment}",
},
}, },
}, },
"icon": { "icon": {
@@ -602,11 +422,12 @@
"windows": { "windows": {
"command": "DataStreamPublisher.exe", "command": "DataStreamPublisher.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0", "cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0"
"env": {
"DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}",
},
}, },
"icon": { "icon": {
"id": "run", "id": "run",
@@ -624,11 +445,12 @@
"windows": { "windows": {
"command": "DataStreamPublisher.exe", "command": "DataStreamPublisher.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/Debug/bin/net8.0", "cwd": "${workspaceFolder}/build/Debug/bin/net8.0"
"env": {
"DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}",
},
}, },
"icon": { "icon": {
"id": "run", "id": "run",
@@ -646,11 +468,12 @@
"windows": { "windows": {
"command": "DataStreamPublisher.exe", "command": "DataStreamPublisher.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/DataStreamPublisher/Configurations/${input:dataStreamPublisherConfig}.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/Release/bin/net8.0", "cwd": "${workspaceFolder}/build/Release/bin/net8.0"
"env": {
"DOTNET_ENVIRONMENT": "${input:dataStreamPublisherEnvironment}",
},
}, },
"icon": { "icon": {
"id": "run", "id": "run",
@@ -668,11 +491,12 @@
"windows": { "windows": {
"command": "PubSubServer.exe", "command": "PubSubServer.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0", "cwd": "${workspaceFolder}/build/${input:buildConfiguration}/bin/net8.0"
"env": {
"DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}",
},
}, },
"icon": { "icon": {
"id": "run", "id": "run",
@@ -690,11 +514,12 @@
"windows": { "windows": {
"command": "PubSubServer.exe", "command": "PubSubServer.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/Debug/bin/net8.0", "cwd": "${workspaceFolder}/build/Debug/bin/net8.0"
"env": {
"DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}",
},
}, },
"icon": { "icon": {
"id": "run", "id": "run",
@@ -711,11 +536,12 @@
"windows": { "windows": {
"command": "PubSubServer.exe", "command": "PubSubServer.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/Debug/bin/net8.0", "cwd": "${workspaceFolder}/build/Debug/bin/net8.0"
"env": {
"DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}",
},
}, },
"icon": { "icon": {
"id": "run", "id": "run",
@@ -733,11 +559,12 @@
"windows": { "windows": {
"command": "PubSubServer.exe", "command": "PubSubServer.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/Release/bin/net8.0", "cwd": "${workspaceFolder}/build/Release/bin/net8.0"
"env": {
"DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}",
},
}, },
"icon": { "icon": {
"id": "run", "id": "run",
@@ -754,11 +581,12 @@
"windows": { "windows": {
"command": "PubSubServer.exe", "command": "PubSubServer.exe",
}, },
"args": [
"--config",
"${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json",
],
"options": { "options": {
"cwd": "${workspaceFolder}/build/Release/bin/net8.0", "cwd": "${workspaceFolder}/build/Release/bin/net8.0"
"env": {
"DOTNET_ENVIRONMENT": "${input:pubSubServerEnvironment}",
},
}, },
"icon": { "icon": {
"id": "run", "id": "run",
@@ -1024,17 +852,6 @@
}, },
], ],
"inputs": [ "inputs": [
{
"id": "apiServerEnvironment",
"type": "pickString",
"description": "Api Server Configuration",
"options": [
"Development",
"Local",
"Staging",
],
"default": "Development",
},
{ {
"id": "buildConfiguration", "id": "buildConfiguration",
"type": "pickString", "type": "pickString",
@@ -1045,16 +862,6 @@
], ],
"default": "Debug", "default": "Debug",
}, },
{
"id": "dataStreamQueryAnalyzerEnvironment",
"type": "pickString",
"description": "DataStreamQueryAnalyzer Configuration",
"options": [
"Development",
"Local",
],
"default": "Development",
},
{ {
"id": "sparkdCmakePreset", "id": "sparkdCmakePreset",
"type": "pickString", "type": "pickString",
@@ -1078,30 +885,26 @@
"default": "sparkd-debug-clang", "default": "sparkd-debug-clang",
}, },
{ {
"id": "dataStreamPublisherEnvironment", "id": "dataStreamPublisherConfig",
"type": "pickString", "type": "pickString",
"description": "Publisher Configuration", "description": "Publisher Configuration",
"options": [ "options": [
"Development", "MarketDataPublisher",
"MarketData", "SimpleEchoClient",
"Production", "SimpleTestDataPublisher",
"ProductionAws", "TestDataPublisher",
"Staging",
], ],
"default": "MarketDataPublisher", "default": "MarketDataPublisher",
}, },
{ {
"id": "pubSubServerEnvironment", "id": "pubSubServerConfig",
"type": "pickString", "type": "pickString",
"description": "PubSub Configuration", "description": "PubSub Configuration",
"options": [ "options": [
"Development", "PubSubServer",
"EchoServer", "SimpleEchoClient",
"Production",
"ProductionAws",
"Staging",
], ],
"default": "Development", "default": "PubSubServer",
}, },
{ {
"id": "sparkConfigQuery", "id": "sparkConfigQuery",
-102
View File
@@ -1,102 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cs", "cs", "{C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Spark.Core", "src\cs\Bts.Spark.Core\Bts.Spark.Core.csproj", "{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Spark.Api", "src\cs\Bts.Spark.Api\Bts.Spark.Api.csproj", "{8949AF88-F1D3-4BC4-827F-B088B555F7B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Extensions.Hosting", "src\cs\Bts.Extensions.Hosting\Bts.Extensions.Hosting.csproj", "{37E4E890-D025-4729-90F9-6F95862F47BC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Spark.Sdk", "src\cs\Bts.Spark.Sdk\Bts.Spark.Sdk.csproj", "{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Spark.Sdk.Demo", "src\cs\Bts.Spark.Sdk.Demo\Bts.Spark.Sdk.Demo.csproj", "{FCFDBDBE-74B0-41C4-9011-C651B21056D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Debug|Any CPU.ActiveCfg = Debug|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Debug|Any CPU.Build.0 = Debug|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Debug|x64.ActiveCfg = Debug|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Debug|x64.Build.0 = Debug|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Debug|x86.ActiveCfg = Debug|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Debug|x86.Build.0 = Debug|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Release|Any CPU.ActiveCfg = Release|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Release|Any CPU.Build.0 = Release|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Release|x64.ActiveCfg = Release|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Release|x64.Build.0 = Release|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Release|x86.ActiveCfg = Release|x64
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C}.Release|x86.Build.0 = Release|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Debug|Any CPU.ActiveCfg = Debug|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Debug|Any CPU.Build.0 = Debug|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Debug|x64.ActiveCfg = Debug|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Debug|x64.Build.0 = Debug|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Debug|x86.ActiveCfg = Debug|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Debug|x86.Build.0 = Debug|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Release|Any CPU.ActiveCfg = Release|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Release|Any CPU.Build.0 = Release|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Release|x64.ActiveCfg = Release|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Release|x64.Build.0 = Release|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Release|x86.ActiveCfg = Release|x64
{8949AF88-F1D3-4BC4-827F-B088B555F7B9}.Release|x86.Build.0 = Release|x64
{37E4E890-D025-4729-90F9-6F95862F47BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Debug|x64.ActiveCfg = Debug|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Debug|x64.Build.0 = Debug|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Debug|x86.ActiveCfg = Debug|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Debug|x86.Build.0 = Debug|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Release|Any CPU.Build.0 = Release|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Release|x64.ActiveCfg = Release|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Release|x64.Build.0 = Release|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Release|x86.ActiveCfg = Release|Any CPU
{37E4E890-D025-4729-90F9-6F95862F47BC}.Release|x86.Build.0 = Release|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Debug|x64.ActiveCfg = Debug|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Debug|x64.Build.0 = Debug|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Debug|x86.ActiveCfg = Debug|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Debug|x86.Build.0 = Debug|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Release|Any CPU.Build.0 = Release|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Release|x64.ActiveCfg = Release|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Release|x64.Build.0 = Release|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Release|x86.ActiveCfg = Release|Any CPU
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579}.Release|x86.Build.0 = Release|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Debug|x64.ActiveCfg = Debug|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Debug|x64.Build.0 = Debug|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Debug|x86.ActiveCfg = Debug|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Debug|x86.Build.0 = Debug|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Release|Any CPU.Build.0 = Release|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Release|x64.ActiveCfg = Release|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Release|x64.Build.0 = Release|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Release|x86.ActiveCfg = Release|Any CPU
{FCFDBDBE-74B0-41C4-9011-C651B21056D4}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{E3BF9514-CB1A-4E07-A8DD-73300FD9726C} = {C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}
{8949AF88-F1D3-4BC4-827F-B088B555F7B9} = {C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}
{37E4E890-D025-4729-90F9-6F95862F47BC} = {C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}
{A5FF3FAF-43CB-496B-AF4B-F61EFD645579} = {C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}
{FCFDBDBE-74B0-41C4-9011-C651B21056D4} = {C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}
EndGlobalSection
EndGlobal
+4 -3
View File
@@ -21,7 +21,7 @@ set(
# SHARED_MEMORY_PREFIX serves as a kind of namespace so multiple applications # SHARED_MEMORY_PREFIX serves as a kind of namespace so multiple applications
# can run simultaneously without fighting over the same shm files (e.g., sparkd, # can run simultaneously without fighting over the same shm files (e.g., sparkd,
# api server, etc.). # api server, etc.).
set(SHARED_MEMORY_PREFIX "\${BTS_SHARED_MEMORY_PREFIX}" CACHE STRING "Prefix to use when creating shared memory files") set(SHARED_MEMORY_PREFIX "bts" CACHE STRING "Prefix to use when creating shared memory files")
set(EXTERNALS_BIN "${EXTERNALS_ROOT}/bin") set(EXTERNALS_BIN "${EXTERNALS_ROOT}/bin")
set(EXTERNALS_INCLUDE "${EXTERNALS_ROOT}/include") set(EXTERNALS_INCLUDE "${EXTERNALS_ROOT}/include")
set(EXTERNALS_LIB "${EXTERNALS_ROOT}/lib/$<CONFIG>") set(EXTERNALS_LIB "${EXTERNALS_ROOT}/lib/$<CONFIG>")
@@ -40,8 +40,9 @@ include_directories(BEFORE SYSTEM ${EXTERNALS_INCLUDE} ${EXTERNALS_ROOT}/include
link_directories(${EXTERNALS_LIB}) link_directories(${EXTERNALS_LIB})
add_compile_definitions(SHARED_MEMORY_PREFIX="${SHARED_MEMORY_PREFIX}") add_compile_definitions(SHARED_MEMORY_PREFIX="${SHARED_MEMORY_PREFIX}")
if(DEFINED APP_DATA_DIR) add_compile_definitions(APP_DATA_DIR="${APP_DATA_DIR}")
add_compile_definitions(APP_DATA_DIR="${APP_DATA_DIR}") if(DEFINED APP_DATA_DIR_OVERRIDE)
add_compile_definitions(APP_DATA_DIR_OVERRIDE="${APP_DATA_DIR_OVERRIDE}")
endif() endif()
add_compile_definitions(EXPORT_MD_CONSUMER="${EXPORT_MD_CONSUMER}") add_compile_definitions(EXPORT_MD_CONSUMER="${EXPORT_MD_CONSUMER}")
if(WIN32) if(WIN32)
+169 -58
View File
@@ -8,41 +8,36 @@
"configurePresets": [ "configurePresets": [
{ {
"name": "spark-base", "name": "spark",
"hidden": true,
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"CONFIG_DEFAULTS_PATH": "spark/config/profiles/default/*.conf",
"EXPORT_MD_CONSUMER": {
"type": "BOOL",
"value": "ON"
}
}
},
{
"name": "spark-windows",
"inherits": "spark-base",
"displayName": "Spark",
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
"rhs": "Windows" "rhs": "Windows"
}, },
"generator": "Visual Studio 17 2022", "generator": "Visual Studio 17 2022",
"binaryDir": "${sourceDir}/build/${presetName}",
"environment": { "environment": {
"SPARK_CMAKE_CXX_FLAGS": "/MP /WX /wd4250 /wd4251 /wd4244 /wd4267 /wd4355 /wd4275 /wd4345 /bigobj /EHsc /DCURL_STATICLIB /D_WINSOCK_DEPRECATED_NO_WARNINGS /D__TBB_NO_IMPLICIT_LINKAGE /DBOOST_ALL_NO_LIB /std:c++20 /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0600" "SPARK_CMAKE_CXX_FLAGS": "/MP /WX /wd4250 /wd4251 /wd4244 /wd4267 /wd4355 /wd4275 /wd4345 /bigobj /EHsc /DCURL_STATICLIB /D_WINSOCK_DEPRECATED_NO_WARNINGS /D__TBB_NO_IMPLICIT_LINKAGE /DBOOST_ALL_NO_LIB /std:c++20 /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0600"
}, },
"cacheVariables": { "cacheVariables": {
"APP_DATA_DIR": "${dollar}{APPDATA}/bts",
"APP_DATA_DIR_OVERRIDE": "${dollar}{SPARK_DATA_DIR}",
"CMAKE_CXX_FLAGS": "$env{SPARK_CMAKE_CXX_FLAGS}", "CMAKE_CXX_FLAGS": "$env{SPARK_CMAKE_CXX_FLAGS}",
"CMAKE_CXX_FLAGS_DEBUG": "$env{SPARK_CMAKE_CXX_FLAGS} /MTd", "CMAKE_CXX_FLAGS_DEBUG": "$env{SPARK_CMAKE_CXX_FLAGS} /MTd",
"CMAKE_CXX_FLAGS_RELEASE": "$env{SPARK_CMAKE_CXX_FLAGS} /MT", "CMAKE_CXX_FLAGS_RELEASE": "$env{SPARK_CMAKE_CXX_FLAGS} /MT",
"CMAKE_CXX_STANDARD": "20",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
"CMAKE_SHARED_LINKER_FLAGS_DEBUG": "/DEBUG", "CMAKE_SHARED_LINKER_FLAGS_DEBUG": "/DEBUG",
"CMAKE_SHARED_LINKER_FLAGS_RELEASE": "/OPT:REF /OPT:ICF /LTCG", "CMAKE_SHARED_LINKER_FLAGS_RELEASE": "/OPT:REF /OPT:ICF /LTCG",
"EXTERNALS_ROOT": "${sourceDir}/externals/windows" "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"EXTERNALS_ROOT": "${sourceDir}/externals/windows",
"CONFIG_DEFAULTS_PATH": "spark/config/profiles/default/*.conf",
"DOTNET_BINARY_DIR": "${sourceDir}/build/$<CONFIG>/bin/net8.0;${sourceDir}/build/$<CONFIG>/bin/net8.0-windows",
"EXPORT_MD_CONSUMER": {
"type": "BOOL",
"value": "ON"
},
"SHARED_MEMORY_PREFIX": "spark"
} }
}, },
@@ -58,6 +53,8 @@
"binaryDir": "${sourceDir}/build/${presetName}", "binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": { "cacheVariables": {
"platform": "", "platform": "",
"APP_DATA_DIR": "${dollar}{HOME}/sparkdata",
"APP_DATA_DIR_OVERRIDE": "${dollar}{SPARKD_DATA_DIR}",
"CMAKE_BUILD_WITH_INSTALL_RPATH": { "CMAKE_BUILD_WITH_INSTALL_RPATH": {
"type": "BOOL", "type": "BOOL",
"value": "OFF" "value": "OFF"
@@ -80,7 +77,8 @@
"BUILD_ADMIN_WEB_APP": { "BUILD_ADMIN_WEB_APP": {
"type": "BOOL", "type": "BOOL",
"value": "ON" "value": "ON"
} },
"SHARED_MEMORY_PREFIX": "sparkd"
} }
}, },
@@ -159,17 +157,22 @@
}, },
{ {
"name": "spark-linux", "name": "spark-api-server-windows",
"inherits": "spark-base", "inherits": "spark",
"displayName": "Spark", "displayName": "Spark Api Server (Windows)",
"condition": { "cacheVariables": {
"type": "equals", "APP_DATA_DIR_OVERRIDE": "${dollar}{SPARK_API_SERVER_DATA_DIR}",
"lhs": "${hostSystemName}", "SHARED_MEMORY_PREFIX": "spark_api_server"
"rhs": "Linux" }
}, },
{
"name": "spark-api-server-linux",
"inherits": "sparkd",
"displayName": "Spark Api Server (Linux)",
"generator": "Ninja Multi-Config", "generator": "Ninja Multi-Config",
"cacheVariables": { "cacheVariables": {
"platform": "linux", "APP_DATA_DIR_OVERRIDE": "${dollar}{SPARK_API_SERVER_DATA_DIR}",
"BUILD_ADMIN_WEB_APP": { "BUILD_ADMIN_WEB_APP": {
"type": "BOOL", "type": "BOOL",
"value": "OFF" "value": "OFF"
@@ -178,26 +181,21 @@
"type": "BOOL", "type": "BOOL",
"value": "OFF" "value": "OFF"
}, },
"CMAKE_BUILD_WITH_INSTALL_RPATH": {
"type": "BOOL",
"value": "OFF"
},
"CMAKE_C_COMPILER": "clang", "CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++", "CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS_DEBUG": "-g -fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -DDEBUG", "CMAKE_CXX_FLAGS_DEBUG": "-g -fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -DDEBUG",
"CMAKE_CXX_FLAGS_RELEASE": "-fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -fno-omit-frame-pointer -DNDEBUG -O3", "CMAKE_CXX_FLAGS_RELEASE": "-fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -fno-omit-frame-pointer -DNDEBUG -O3",
"CMAKE_EXE_LINKER_FLAGS": "-Wno-undef", "CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
"CMAKE_EXPORT_COMPILE_COMMANDS": { "CMAKE_EXPORT_COMPILE_COMMANDS": {
"type": "BOOL", "type": "BOOL",
"value": "ON" "value": "ON"
}, },
"CMAKE_INSTALL_RPATH": ".", "CONFIG_DEFAULTS_PATH": "spark/config/profiles/default/*.conf",
"CMAKE_PREFIX_PATH": "${sourceDir}/cmake/;${sourceDir}/.venv/lib/python3.10/site-packages/pybind11/share/cmake/pybind11", "DOTNET_BINARY_DIR": "${sourceDir}/build/$<CONFIG>/bin/net8.0",
"DATABENTO_USE_EXTERNAL_JSON": { "EXPORT_MD_CONSUMER": {
"type": "BOOL", "type": "BOOL",
"value": "ON" "value": "ON"
}, }
"EXTERNALS_ROOT": "${sourceDir}/externals/linux"
} }
}, },
@@ -217,32 +215,92 @@
"cacheVariables": { "cacheVariables": {
"CCAPI_LOG_LEVEL": "Trace" "CCAPI_LOG_LEVEL": "Trace"
} }
} },
],
"buildPresets": [
{ {
"name": "spark-windows", "name": "data-stream-suite-windows",
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
"rhs": "Windows" "rhs": "Windows"
}, },
"hidden": true, "inherits": "spark",
"configurePreset": "spark-windows" "displayName": "Data Stream Suite (Windows)",
"description": "Data Stream utils ported over from Edge",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"APP_DATA_DIR": "${dollar}{APPDATA}/bts/DataStream",
"APP_DATA_DIR_OVERRIDE": "${dollar}{DATA_STREAM_DATA_DIR}",
"CONFIG_DEFAULTS_PATH": "spark/config/profiles/default/*.conf;spark/config/profiles/data_stream/*.conf",
"SHARED_MEMORY_PREFIX": "data_stream"
}
}, },
{ {
"name": "spark-windows-debug", "name": "data-stream-suite-linux",
"displayName": "Data Stream Suite (Linux)",
"description": "Data Stream utils ported over from Edge",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"inherits": "sparkd",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"APP_DATA_DIR": "${dollar}{HOME}/.local/share/DataStream",
"APP_DATA_DIR_OVERRIDE": "${dollar}{DATA_STREAM_DATA_DIR}",
"BUILD_ADMIN_WEB_APP": {
"type": "BOOL",
"value": "OFF"
},
"BUILD_SDK": {
"type": "BOOL",
"value": "OFF"
},
"BUILD_SPARKD": {
"type": "BOOL",
"value": "OFF"
},
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS_DEBUG": "-g -fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -DDEBUG",
"CMAKE_CXX_FLAGS_RELEASE": "-fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers --std=c++20 -fdiagnostics-color -fno-omit-frame-pointer -DNDEBUG -O3",
"CONFIG_DEFAULTS_PATH": "spark/config/profiles/default/*.conf;spark/config/profiles/data_stream/*.conf",
"DOTNET_BINARY_DIR": "${sourceDir}/build/$<CONFIG>/bin/net7.0",
"EXPORT_MD_CONSUMER": {
"type": "BOOL",
"value": "ON"
},
"SHARED_MEMORY_PREFIX": "data_stream"
}
}
],
"buildPresets": [
{
"name": "spark",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"hidden": true
},
{
"name": "spark-debug",
"displayName": "Spark (Debug)", "displayName": "Spark (Debug)",
"inherits": "spark-windows", "inherits": "spark",
"configurePreset": "spark",
"configuration": "Debug" "configuration": "Debug"
}, },
{ {
"name": "spark-windows-release", "name": "spark-release",
"displayName": "Spark (Release)", "displayName": "Spark (Release)",
"inherits": "spark-windows", "inherits": "spark",
"configurePreset": "spark",
"configuration": "Release" "configuration": "Release"
}, },
@@ -285,27 +343,52 @@
}, },
{ {
"name": "spark-linux", "name": "spark-api-server-windows",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"hidden": true,
"configurePreset": "spark-api-server-windows"
},
{
"name": "spark-api-server-windows-debug",
"displayName": "Spark Api Server (Windows | Debug)",
"inherits": "spark-api-server-windows",
"configuration": "Debug"
},
{
"name": "spark-api-server-windows-release",
"displayName": "Spark Api Server (Windows | Release)",
"inherits": "spark-api-server-windows",
"configuration": "Release"
},
{
"name": "spark-api-server-linux",
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
"rhs": "Linux" "rhs": "Linux"
}, },
"hidden": true, "hidden": true,
"configurePreset": "spark-linux" "configurePreset": "spark-api-server-linux"
}, },
{ {
"name": "spark-linux-debug", "name": "spark-api-server-linux-debug",
"inherits": "spark-linux", "inherits": "spark-api-server-linux",
"displayName": "Spark (Linux | Debug)", "displayName": "Spark Api Server (Linux | Debug)",
"configuration": "Debug" "configuration": "Debug"
}, },
{ {
"name": "spark-linux-release", "name": "spark-api-server-linux-release",
"inherits": "spark-linux", "inherits": "spark-api-server-linux",
"displayName": "Spark (Linux | Release)", "displayName": "Spark Api Server (Linux | Release)",
"configuration": "Release" "configuration": "Release"
}, },
@@ -322,6 +405,34 @@
"configurePreset": "sparkd-ccapi-diag", "configurePreset": "sparkd-ccapi-diag",
"displayName": "Debug (ccapi diag)", "displayName": "Debug (ccapi diag)",
"inherits": "sparkd" "inherits": "sparkd"
},
{
"name": "data-stream-suite-windows-debug",
"displayName": "Data Stream Suite (Windows | Debug)",
"configurePreset": "data-stream-suite-windows",
"configuration": "Debug"
},
{
"name": "data-stream-suite-windows-release",
"displayName": "Data Stream Suite (Windows | Release)",
"configurePreset": "data-stream-suite-windows",
"configuration": "Release"
},
{
"name": "data-stream-suite-linux-debug",
"displayName": "Data Stream Suite (Linux | Debug)",
"configurePreset": "data-stream-suite-linux",
"configuration": "Debug"
},
{
"name": "data-stream-suite-linux-release",
"displayName": "Data Stream Suite (Linux | Release)",
"configurePreset": "data-stream-suite-linux",
"configuration": "Release"
} }
] ]
} }
+26 -406
View File
@@ -1,11 +1,10 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.3.32922.545 VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bts.Spark.Api", "src\cs\Bts.Spark.Api\Bts.Spark.Api.csproj", "{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_api", "src\client\spark_api\spark_api.csproj", "{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bts.Spark.Core", "src\cs\Bts.Spark.Core\Bts.Spark.Core.csproj", "{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_core", "src\client\spark_core\spark_core.csproj", "{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_websocket", "src\client\spark_websocket\spark_websocket.csproj", "{3201359D-C071-4089-9EDE-B04D759F1508}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_websocket", "src\client\spark_websocket\spark_websocket.csproj", "{3201359D-C071-4089-9EDE-B04D759F1508}"
EndProject EndProject
@@ -43,538 +42,168 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.ColumnExpressions", "sr
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStream", "src\DataStreamSuite\DataStream\DataStream.csproj", "{39AEA075-6457-46C0-8821-1158BE6EFA57}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStream", "src\DataStreamSuite\DataStream\DataStream.csproj", "{39AEA075-6457-46C0-8821-1158BE6EFA57}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Extensions.Hosting", "src\cs\Bts.Extensions.Hosting\Bts.Extensions.Hosting.csproj", "{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cs", "cs", "{385C4948-E080-56A6-E29E-8B0F4913175C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Net", "src\cs\Bts.Net\Bts.Net.csproj", "{43FB297B-7A4D-4835-A878-E6DF345B580C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.IO.Compression", "src\cs\Bts.IO.Compression\Bts.IO.Compression.csproj", "{BC277499-8215-4F9F-B9AB-07B6391110BF}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
MinSizeRel|x64 = MinSizeRel|x64 MinSizeRel|x64 = MinSizeRel|x64
MinSizeRel|Any CPU = MinSizeRel|Any CPU
MinSizeRel|x86 = MinSizeRel|x86
Release|x64 = Release|x64 Release|x64 = Release|x64
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
RelWithDebInfo|x64 = RelWithDebInfo|x64 RelWithDebInfo|x64 = RelWithDebInfo|x64
RelWithDebInfo|Any CPU = RelWithDebInfo|Any CPU
RelWithDebInfo|x86 = RelWithDebInfo|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x64.ActiveCfg = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x64.ActiveCfg = Debug|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x64.Build.0 = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x64.Build.0 = Debug|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x86.ActiveCfg = Debug|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x86.Build.0 = Debug|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x64.ActiveCfg = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x64.ActiveCfg = Release|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x64.Build.0 = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x64.Build.0 = Release|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.ActiveCfg = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.ActiveCfg = Release|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.Build.0 = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.Build.0 = Release|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|Any CPU.Build.0 = Release|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x86.ActiveCfg = Release|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x86.Build.0 = Release|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.Build.0 = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.Build.0 = Release|x64
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x64.ActiveCfg = Debug|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x64.ActiveCfg = Debug|x64
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x64.Build.0 = Debug|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x64.Build.0 = Debug|x64
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x86.ActiveCfg = Debug|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x86.Build.0 = Debug|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x64.ActiveCfg = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x64.ActiveCfg = Release|x64
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x64.Build.0 = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x64.Build.0 = Release|x64
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x64.ActiveCfg = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x64.ActiveCfg = Release|x64
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x64.Build.0 = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x64.Build.0 = Release|x64
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|Any CPU.Build.0 = Release|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x86.ActiveCfg = Release|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x86.Build.0 = Release|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x64.Build.0 = Release|x64 {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x64.Build.0 = Release|x64
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.ActiveCfg = Debug|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.ActiveCfg = Debug|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.Build.0 = Debug|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.Build.0 = Debug|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x86.ActiveCfg = Debug|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x86.Build.0 = Debug|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.ActiveCfg = Debug|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.ActiveCfg = Debug|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.Build.0 = Debug|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.Build.0 = Debug|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.ActiveCfg = Release|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.ActiveCfg = Release|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.Build.0 = Release|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.Build.0 = Release|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.Release|Any CPU.Build.0 = Release|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.Release|x86.ActiveCfg = Release|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.Release|x86.Build.0 = Release|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.Build.0 = Release|x64 {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.Build.0 = Release|x64
{3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.ActiveCfg = Debug|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.ActiveCfg = Debug|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.Build.0 = Debug|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.Build.0 = Debug|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x86.ActiveCfg = Debug|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x86.Build.0 = Debug|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.ActiveCfg = Debug|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.ActiveCfg = Debug|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.Build.0 = Debug|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.Build.0 = Debug|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.ActiveCfg = Release|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.ActiveCfg = Release|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.Build.0 = Release|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.Build.0 = Release|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|Any CPU.Build.0 = Release|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x86.ActiveCfg = Release|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x86.Build.0 = Release|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.Build.0 = Release|x64 {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.Build.0 = Release|x64
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x64.ActiveCfg = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x64.ActiveCfg = Debug|x64
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x64.Build.0 = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x64.Build.0 = Debug|x64
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x86.ActiveCfg = Debug|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Debug|x86.Build.0 = Debug|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x64.ActiveCfg = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x64.ActiveCfg = Debug|x64
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x64.Build.0 = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x64.Build.0 = Debug|x64
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x64.ActiveCfg = Release|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x64.ActiveCfg = Release|x64
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x64.Build.0 = Release|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x64.Build.0 = Release|x64
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|Any CPU.Build.0 = Release|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x86.ActiveCfg = Release|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.Release|x86.Build.0 = Release|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x64.ActiveCfg = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x64.ActiveCfg = Debug|x64
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x64.Build.0 = Debug|x64 {EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x64.Build.0 = Debug|x64
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{EFC9FC4D-E92B-4C6D-9B97-26D38EAA118D}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x64.ActiveCfg = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x64.ActiveCfg = Debug|x64
{89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x64.Build.0 = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x64.Build.0 = Debug|x64
{89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x86.ActiveCfg = Debug|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.Debug|x86.Build.0 = Debug|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x64.ActiveCfg = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x64.ActiveCfg = Debug|x64
{89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x64.Build.0 = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x64.Build.0 = Debug|x64
{89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x64.ActiveCfg = Release|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x64.ActiveCfg = Release|x64
{89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x64.Build.0 = Release|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x64.Build.0 = Release|x64
{89D666E6-B500-498F-B026-4D167F68ADFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.Release|Any CPU.Build.0 = Release|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x86.ActiveCfg = Release|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.Release|x86.Build.0 = Release|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x64.ActiveCfg = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x64.ActiveCfg = Debug|x64
{89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x64.Build.0 = Debug|x64 {89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x64.Build.0 = Debug|x64
{89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{89D666E6-B500-498F-B026-4D167F68ADFC}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x64.ActiveCfg = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x64.ActiveCfg = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x64.Build.0 = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x64.Build.0 = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x86.ActiveCfg = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Debug|x86.Build.0 = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x64.Build.0 = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x64.ActiveCfg = Release|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x64.ActiveCfg = Release|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x64.Build.0 = Release|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x64.Build.0 = Release|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|Any CPU.Build.0 = Release|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x86.ActiveCfg = Release|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.Release|x86.Build.0 = Release|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{EF26A475-6101-4C9C-A717-D60BB92A2302}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x64.ActiveCfg = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x64.ActiveCfg = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x64.Build.0 = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x64.Build.0 = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x86.ActiveCfg = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Debug|x86.Build.0 = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x64.Build.0 = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x64.ActiveCfg = Release|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x64.ActiveCfg = Release|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x64.Build.0 = Release|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x64.Build.0 = Release|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|Any CPU.Build.0 = Release|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x86.ActiveCfg = Release|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.Release|x86.Build.0 = Release|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{911B08A3-515A-441D-84C8-8A43740B5FC1}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Debug|x64.ActiveCfg = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.Debug|x64.ActiveCfg = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Debug|x64.Build.0 = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.Debug|x64.Build.0 = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Debug|x86.ActiveCfg = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Debug|x86.Build.0 = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x64.Build.0 = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Release|x64.ActiveCfg = Release|Any CPU {14140310-2233-430A-821B-F3058A25234B}.Release|x64.ActiveCfg = Release|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Release|x64.Build.0 = Release|Any CPU {14140310-2233-430A-821B-F3058A25234B}.Release|x64.Build.0 = Release|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Release|Any CPU.Build.0 = Release|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Release|x86.ActiveCfg = Release|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.Release|x86.Build.0 = Release|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{14140310-2233-430A-821B-F3058A25234B}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x64.ActiveCfg = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x64.ActiveCfg = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x64.Build.0 = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x64.Build.0 = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x86.ActiveCfg = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Debug|x86.Build.0 = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x64.Build.0 = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x64.ActiveCfg = Release|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x64.ActiveCfg = Release|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x64.Build.0 = Release|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x64.Build.0 = Release|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|Any CPU.Build.0 = Release|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x86.ActiveCfg = Release|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.Release|x86.Build.0 = Release|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{43146EA8-6FCC-46B8-88B0-42F9BB5E6E0A}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x64.ActiveCfg = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x64.ActiveCfg = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x64.Build.0 = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x64.Build.0 = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x86.ActiveCfg = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Debug|x86.Build.0 = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x64.Build.0 = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x64.ActiveCfg = Release|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x64.ActiveCfg = Release|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x64.Build.0 = Release|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x64.Build.0 = Release|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|Any CPU.Build.0 = Release|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x86.ActiveCfg = Release|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.Release|x86.Build.0 = Release|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{6F22DB96-6EAB-4034-99D9-287021C36F01}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x64.ActiveCfg = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x64.ActiveCfg = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x64.Build.0 = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x64.Build.0 = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x86.ActiveCfg = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Debug|x86.Build.0 = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x64.Build.0 = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x64.ActiveCfg = Release|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x64.ActiveCfg = Release|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x64.Build.0 = Release|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x64.Build.0 = Release|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|Any CPU.Build.0 = Release|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x86.ActiveCfg = Release|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.Release|x86.Build.0 = Release|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{A5C33956-A41F-49B3-A41D-1082CBA59D02}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x64.ActiveCfg = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x64.ActiveCfg = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x64.Build.0 = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x64.Build.0 = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x86.ActiveCfg = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Debug|x86.Build.0 = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x64.Build.0 = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x64.ActiveCfg = Release|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x64.ActiveCfg = Release|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x64.Build.0 = Release|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x64.Build.0 = Release|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|Any CPU.Build.0 = Release|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x86.ActiveCfg = Release|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.Release|x86.Build.0 = Release|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x64.ActiveCfg = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x64.ActiveCfg = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x64.Build.0 = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x64.Build.0 = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x86.ActiveCfg = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Debug|x86.Build.0 = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x64.Build.0 = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x64.ActiveCfg = Release|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x64.ActiveCfg = Release|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x64.Build.0 = Release|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x64.Build.0 = Release|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|Any CPU.Build.0 = Release|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x86.ActiveCfg = Release|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.Release|x86.Build.0 = Release|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x64.ActiveCfg = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x64.ActiveCfg = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x64.Build.0 = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x64.Build.0 = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x86.ActiveCfg = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Debug|x86.Build.0 = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x64.Build.0 = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x64.ActiveCfg = Release|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x64.ActiveCfg = Release|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x64.Build.0 = Release|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x64.Build.0 = Release|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Release|Any CPU.Build.0 = Release|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x86.ActiveCfg = Release|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.Release|x86.Build.0 = Release|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{B945A183-2174-4ACB-B289-8A5C546656FE}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x64.ActiveCfg = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x64.Build.0 = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x86.ActiveCfg = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x86.Build.0 = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x64.ActiveCfg = Release|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x64.Build.0 = Release|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|Any CPU.Build.0 = Release|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x86.ActiveCfg = Release|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x86.Build.0 = Release|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x64.ActiveCfg = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x64.Build.0 = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x86.ActiveCfg = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x86.Build.0 = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x64.ActiveCfg = Release|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x64.Build.0 = Release|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|Any CPU.Build.0 = Release|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x86.ActiveCfg = Release|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x86.Build.0 = Release|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x64.ActiveCfg = Debug|Any CPU {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x64.ActiveCfg = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x64.Build.0 = Debug|Any CPU {39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x64.Build.0 = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x86.ActiveCfg = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Debug|x86.Build.0 = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x64.Build.0 = Debug|Any CPU {39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.MinSizeRel|x86.Build.0 = MinSizeRel|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x64.ActiveCfg = Release|Any CPU {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x64.ActiveCfg = Release|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x64.Build.0 = Release|Any CPU {39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x64.Build.0 = Release|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|Any CPU.Build.0 = Release|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x86.ActiveCfg = Release|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.Release|x86.Build.0 = Release|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU {39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x64.ActiveCfg = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Debug|x64.Build.0 = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{39AEA075-6457-46C0-8821-1158BE6EFA57}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|x64.ActiveCfg = Debug|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x64.ActiveCfg = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|x64.Build.0 = Debug|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.Release|x64.Build.0 = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|Any CPU.Build.0 = Debug|Any CPU {9F6D7DE8-185B-4C1D-B809-3314D092DF28}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|x86.ActiveCfg = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x64.ActiveCfg = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Debug|x86.Build.0 = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Debug|x64.Build.0 = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|x64.Build.0 = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x64.ActiveCfg = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.Release|x64.Build.0 = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.MinSizeRel|x86.Build.0 = Debug|Any CPU {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|x64.ActiveCfg = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|x64.Build.0 = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|Any CPU.Build.0 = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|x86.ActiveCfg = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.Release|x86.Build.0 = Release|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
{F3DC52D7-8C59-4EC0-86D9-0E5732EAFCF7}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Debug|x64.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Debug|x64.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Debug|x86.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Debug|x86.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.MinSizeRel|x86.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Release|x64.ActiveCfg = Release|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Release|x64.Build.0 = Release|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Release|Any CPU.Build.0 = Release|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Release|x86.ActiveCfg = Release|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.Release|x86.Build.0 = Release|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
{43FB297B-7A4D-4835-A878-E6DF345B580C}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Debug|x64.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Debug|x64.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Debug|x86.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Debug|x86.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.MinSizeRel|x86.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Release|x64.ActiveCfg = Release|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Release|x64.Build.0 = Release|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Release|Any CPU.Build.0 = Release|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Release|x86.ActiveCfg = Release|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.Release|x86.Build.0 = Release|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
{BC277499-8215-4F9F-B9AB-07B6391110BF}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {422D1620-0166-4C26-9A81-CA8A2EB1AB58}
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} = {267F81EF-A8AB-49FD-9F56-D7EC3C1F7C7C} {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} = {267F81EF-A8AB-49FD-9F56-D7EC3C1F7C7C}
{EF26A475-6101-4C9C-A717-D60BB92A2302} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {EF26A475-6101-4C9C-A717-D60BB92A2302} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6}
@@ -586,17 +215,8 @@ Global
{2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {2FE745C3-1EDF-4421-8CD7-A63EE0C1AE43} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6}
{FDA791E0-2B91-4AD5-B91D-CF920A4C4E38} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {FDA791E0-2B91-4AD5-B91D-CF920A4C4E38} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6}
{B945A183-2174-4ACB-B289-8A5C546656FE} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {B945A183-2174-4ACB-B289-8A5C546656FE} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6}
{39AEA075-6457-46C0-8821-1158BE6EFA57} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6}
{9F6D7DE8-185B-4C1D-B809-3314D092DF28} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {9F6D7DE8-185B-4C1D-B809-3314D092DF28} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6}
{6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6} {6BD3F6D8-B6FC-44E8-B8FE-06352F638B9B} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6}
{39AEA075-6457-46C0-8821-1158BE6EFA57} = {C09ED521-D2DF-40BC-A76F-EB3CB870B2F6}
{385C4948-E080-56A6-E29E-8B0F4913175C} = {267F81EF-A8AB-49FD-9F56-D7EC3C1F7C7C}
{43FB297B-7A4D-4835-A878-E6DF345B580C} = {385C4948-E080-56A6-E29E-8B0F4913175C}
{BC277499-8215-4F9F-B9AB-07B6391110BF} = {385C4948-E080-56A6-E29E-8B0F4913175C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {422D1620-0166-4C26-9A81-CA8A2EB1AB58}
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal
+164
View File
@@ -0,0 +1,164 @@
set(Protobuf_PROTOC_EXECUTABLE "${EXTERNALS_BIN}/protoc")
set(PROTOBUF_INCLUDE_DIRS "${EXTERNALS_INCLUDE}")
set(PROTOBUF_STATIC_LIB "libprotobuf")
set(_protobuf_src_dir ${CMAKE_SOURCE_DIR}/src/lib_spark)
set(_protobuf_bin_dir ${CMAKE_BINARY_DIR}/src/lib_spark)
function(Protobuf_Generate_Cpp)
set(_options)
set(_one_value_args CXX_SOURCES CXX_HEADERS CXX_OUT_DIR)
set(_multi_value_args PROTO_INCLUDE_DIRS PROTO_SOURCES)
cmake_parse_arguments(_ARGS "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
set(${_ARGS_CXX_SOURCES})
set(${_ARGS_CXX_HEADERS})
set(_proto_include_cli_args)
foreach(_dir ${_ARGS_PROTO_INCLUDE_DIRS})
list(APPEND _proto_include_cli_args -I ${_dir})
endforeach()
foreach(FIL ${_ARGS_PROTO_SOURCES})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
get_filename_component(FIL_DIR ${FIL} DIRECTORY)
if(FIL_DIR)
set(FIL_WE "${FIL_DIR}/${FIL_WE}")
endif()
list(APPEND ${_ARGS_CXX_SOURCES} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${_ARGS_CXX_HEADERS} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h")
add_custom_command(
OUTPUT "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h"
COMMAND
${Protobuf_PROTOC_EXECUTABLE} ARGS --cpp_out=${_ARGS_CXX_OUT_DIR} ${_proto_include_cli_args} ${ABS_FIL}
DEPENDS ${ABS_FIL}
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM)
endforeach()
set_source_files_properties(${${_ARGS_CXX_SOURCES}} ${${_ARGS_CXX_HEADERS}} PROPERTIES GENERATED TRUE)
# remove some warnings from protobuf generated files
if(WIN32)
set_source_files_properties(${${_ARGS_CXX_SOURCES}} PROPERTIES COMPILE_FLAGS
"/wd4309 /wd4838")
else()
set_source_files_properties(
${${_ARGS_CXX_SOURCES}}
PROPERTIES
COMPILE_FLAGS
"-Wno-unused-parameter -Wno-effc++ -Wno-pedantic -Wno-sign-compare -Wno-uninitialized"
)
endif()
set(${_ARGS_CXX_SOURCES}
${${_ARGS_CXX_SOURCES}}
PARENT_SCOPE)
set(${_ARGS_CXX_HEADERS}
${${_ARGS_CXX_HEADERS}}
PARENT_SCOPE)
endfunction()
function(Service_Compiler_Generate_Cpp)
set(_options)
set(_one_value_args CXX_SOURCES CXX_HEADERS CXX_OUT_DIR)
set(_multi_value_args PROTO_INCLUDE_DIRS PROTO_SOURCES)
cmake_parse_arguments(_ARGS "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
set(${_ARGS_CXX_SOURCES})
set(${_ARGS_CXX_HEADERS})
set(_proto_include_cli_args)
foreach(_dir ${_ARGS_PROTO_INCLUDE_DIRS})
list(APPEND _proto_include_cli_args -I ${_dir})
endforeach()
foreach(FIL ${_ARGS_PROTO_SOURCES})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
get_filename_component(FIL_DIR ${FIL} DIRECTORY)
if(FIL_DIR)
set(FIL_WE "${FIL_DIR}/${FIL_WE}")
endif()
list(APPEND ${_ARGS_CXX_SOURCES} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${_ARGS_CXX_HEADERS} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h")
list(APPEND ${_ARGS_CXX_SOURCES} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.cc")
list(APPEND ${_ARGS_CXX_HEADERS} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.h")
list(APPEND ${_ARGS_CXX_SOURCES} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.cc")
list(APPEND ${_ARGS_CXX_HEADERS} "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.h")
set(TEMPLATES
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/cpp/client.pb.cc
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/cpp/client.pb.h
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/cpp/server.pb.cc
${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/templates/cpp/server.pb.h
)
set(_plugin_py ${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/plugin.py)
if(WIN32)
set(_plugin_cmd ${CMAKE_SOURCE_DIR}/src/lib_spark/spark/api/service_compiler/plugin.cmd)
add_custom_command(
OUTPUT "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.h"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.h"
COMMAND SET PYTHONPATH=${SPARK_PYTHON}
COMMAND ${CMAKE_SOURCE_DIR}/.venv/Scripts/activate.bat
COMMAND
${Protobuf_PROTOC_EXECUTABLE} ARGS --cpp_out=${_ARGS_CXX_OUT_DIR}
--plugin=protoc-gen-service=${_plugin_cmd}
--service_out=lang=cpp:${_ARGS_CXX_OUT_DIR} -I
${PROTOBUF_INCLUDE_DIRS} -I ${_protobuf_src_dir} ${ABS_FIL}
DEPENDS ${ABS_FIL} ${TEMPLATES} ${_plugin_cmd} ${_plugin_py}
COMMENT "Running C++ service compiler on ${FIL}"
VERBATIM)
else()
add_custom_command(
OUTPUT "${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.pb.h"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.client.pb.h"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.cc"
"${_ARGS_CXX_OUT_DIR}/${FIL_WE}.server.pb.h"
COMMAND ${CMAKE_SOURCE_DIR}/tools/venv_exec.sh
ARGS
${Protobuf_PROTOC_EXECUTABLE}
--cpp_out=${_ARGS_CXX_OUT_DIR}
--plugin=protoc-gen-service=${_plugin_py}
--service_out=lang=cpp,make_file_name=${ABS_FIL}:${_ARGS_CXX_OUT_DIR}
${_proto_include_cli_args} ${ABS_FIL}
DEPENDS ${ABS_FIL} ${TEMPLATES} ${_plugin_py}
COMMENT "Running C++ service compiler on ${FIL}"
VERBATIM)
endif()
endforeach()
# remove some warnings from protobuf generated files
if(WIN32)
set_source_files_properties(${${_ARGS_CXX_SOURCES}} PROPERTIES COMPILE_FLAGS
"/wd4309 /wd4838")
else()
set_source_files_properties(
${${_ARGS_CXX_SOURCES}}
PROPERTIES
COMPILE_FLAGS
"-Wno-unused-parameter -Wno-effc++ -Wno-pedantic -Wno-sign-compare -Wno-uninitialized"
)
endif()
set(${_ARGS_CXX_SOURCES}
${${_ARGS_CXX_SOURCES}}
PARENT_SCOPE)
set(${_ARGS_CXX_HEADERS}
${${_ARGS_CXX_HEADERS}}
PARENT_SCOPE)
endfunction()
+44 -151
View File
@@ -1,8 +1,7 @@
services: services:
sparkd: sparkd:
volumes: volumes:
- ${SPARKD__DATA_DIR:-sparkd_data}:/home/bts/.local/share/bts/sparkd/data - ${SPARKD__DATA_DIR:-sparkd_data}:/home/bts/sparkdata/data
- ${SPARKD__MD_RECORDING_DIR:-md_recording}:/md_recording
build: build:
dockerfile: src/app_sparkd/Dockerfile dockerfile: src/app_sparkd/Dockerfile
args: args:
@@ -10,35 +9,24 @@ services:
- SOURCE_DIR=${SPARKD__SOURCE_DIR} - SOURCE_DIR=${SPARKD__SOURCE_DIR}
- CONFIG_DIR=${SPARKD__CONFIG_DIR} - CONFIG_DIR=${SPARKD__CONFIG_DIR}
- PYTHON_REQUIREMENTS=${SPARKD__PYTHON_REQUIREMENTS} - PYTHON_REQUIREMENTS=${SPARKD__PYTHON_REQUIREMENTS}
- SPARKD_ENTRYPOINT=${SPARKD__SPARKD_ENTRYPOINT}
shm_size: "${SPARKD__SHM_SIZE:-512mb}" shm_size: "${SPARKD__SHM_SIZE:-512mb}"
env_file: command: >
- .env sh -c "
- ${SPARKD__CONFIG_DIR}/.env echo bts | sudo -S chown -R bts:bts /home/bts/sparkdata/data
ports: if [ -e "/home/bts/sparkdata/data/logging.sparkd/log" ]; then
- "${SPARKD__CONFIG_PORT}:${SPARKD__CONFIG_PORT}" mv "/home/bts/sparkdata/data/logging.sparkd/log" "/home/bts/sparkdata/data/logging.sparkd/log_$(date '+%Y%m%d-%H%M')"
- "${SPARKD__QUICKBUS_PORT}:${SPARKD__QUICKBUS_PORT}" fi
- "${SPARKD__SIM_FIX_PORT}:${SPARKD__SIM_FIX_PORT}" if [ -e "/home/bts/sparkdata/conf/.env.local" ]; then
entrypoint: ${SPARKD__MAIN_ENTRYPOINT} echo 'Sourcing /home/bts/sparkdata/conf/.env.local'
deploy: set -a
resources: . /home/bts/sparkdata/conf/.env.local
limits: set +a
memory: "${SPARKD__MEMORY:-4gb}" fi
if [ -d /home/bts/sparkdata/conf/plugins ]; then
sparkd-shell: echo 'Copying /home/bts/sparkdata/conf/plugins to runtime dir (/home/bts/bin)'
volumes: cp -r /home/bts/sparkdata/conf/plugins /home/bts/bin/
- ${SPARKD__DATA_DIR:-sparkd_data}:/home/bts/.local/share/bts/sparkd/data fi
- ${SPARKD__MD_RECORDING_DIR:-md_recording}:/md_recording ./sparkd run"
build:
dockerfile: docker/images/bluetradingsystems/linux_shell/Dockerfile
args:
- IMAGE=${SPARKD__IMAGE}
- SOURCE_DIR=${SPARKD__SOURCE_DIR}
- CONFIG_DIR=${SPARKD__CONFIG_DIR}
- PYTHON_REQUIREMENTS=${SPARKD__PYTHON_REQUIREMENTS}
- SPARKD_ENTRYPOINT=${SPARKD__SPARKD_ENTRYPOINT}
shm_size: "${SPARKD__SHM_SIZE:-512mb}"
command: "do sleep 1; done"
env_file: env_file:
- .env - .env
- ${SPARKD__CONFIG_DIR}/.env - ${SPARKD__CONFIG_DIR}/.env
@@ -53,9 +41,8 @@ services:
sparkd-symbols: sparkd-symbols:
volumes: volumes:
- ${SPARKD__DATA_DIR:-sparkd_data}:/home/bts/.local/share/bts/sparkd/data - ${SPARKD__DATA_DIR:-sparkd_data}:/home/bts/sparkdata/data
- ${SPARKD__MD_RECORDING_DIR:-md_recording}:/md_recording - ${SPARKD__RUNTIME_CONF_DIR:-sparkd_conf}:/home/bts/sparkdata/conf
- ${SPARKD__RUNTIME_CONF_DIR:-sparkd_conf}:/home/bts/.local/share/bts/sparkd/conf
build: build:
dockerfile: src/app_sparkd/Dockerfile dockerfile: src/app_sparkd/Dockerfile
args: args:
@@ -63,8 +50,26 @@ services:
- SOURCE_DIR=${SPARKD__SOURCE_DIR} - SOURCE_DIR=${SPARKD__SOURCE_DIR}
- CONFIG_DIR=${SPARKD__CONFIG_DIR} - CONFIG_DIR=${SPARKD__CONFIG_DIR}
- PYTHON_REQUIREMENTS=${SPARKD__PYTHON_REQUIREMENTS} - PYTHON_REQUIREMENTS=${SPARKD__PYTHON_REQUIREMENTS}
- SPARKD_ENTRYPOINT=${SPARKD__SPARKD_ENTRYPOINT}
shm_size: "${SPARKD__SHM_SIZE:-512mb}" shm_size: "${SPARKD__SHM_SIZE:-512mb}"
command: >
sh -c "
echo bts | sudo -S chown -R bts:bts /home/bts/sparkdata
if [ -e "/home/bts/sparkdata/data/logging.sparkd/log" ]; then
mv "/home/bts/sparkdata/data/logging.sparkd/log" "/home/bts/sparkdata/data/logging.sparkd/log_$(date '+%Y%m%d-%H%M')"
fi
ls -alh /home/bts/sparkdata/conf/
cat /home/bts/sparkdata/conf/.env.local
if [ -e "/home/bts/sparkdata/conf/.env.local" ]; then
echo 'Sourcing /home/bts/sparkdata/conf/.env.local'
set -a
. /home/bts/sparkdata/conf/.env.local
set +a
fi
if [ -d /home/bts/sparkdata/conf/plugins ]; then
echo 'Copying /home/bts/sparkdata/conf/plugins to runtime dir (/home/bts/bin)'
cp -r /home/bts/sparkdata/conf/plugins /home/bts/bin/
fi
./sparkd run"
env_file: env_file:
- .env - .env
- ${SPARKD__CONFIG_DIR}/.env - ${SPARKD__CONFIG_DIR}/.env
@@ -72,33 +77,6 @@ services:
- "${SPARKD__CONFIG_PORT}:${SPARKD__CONFIG_PORT}" - "${SPARKD__CONFIG_PORT}:${SPARKD__CONFIG_PORT}"
- "${SPARKD__QUICKBUS_PORT}:${SPARKD__QUICKBUS_PORT}" - "${SPARKD__QUICKBUS_PORT}:${SPARKD__QUICKBUS_PORT}"
- "${SPARKD__SIM_FIX_PORT}:${SPARKD__SIM_FIX_PORT}" - "${SPARKD__SIM_FIX_PORT}:${SPARKD__SIM_FIX_PORT}"
entrypoint: ${SPARKD__MAIN_ENTRYPOINT}
deploy:
restart_policy:
condition: any
delay: 3s
resources:
limits:
memory: "${SPARKD__MEMORY:-4gb}"
sparkd-multicast:
volumes:
- ${SPARKD__DATA_DIR:-sparkd_data}:/home/bts/.local/share/bts/sparkd/data
- ${SPARKD__MD_RECORDING_DIR:-md_recording}:/md_recording
- ${SPARKD__RUNTIME_CONF_DIR:-sparkd_conf}:/home/bts/.local/share/bts/sparkd/conf
build:
dockerfile: src/app_sparkd/Dockerfile
args:
- IMAGE=${SPARKD__IMAGE}
- SOURCE_DIR=${SPARKD__SOURCE_DIR}
- CONFIG_DIR=${SPARKD__CONFIG_DIR}
- PYTHON_REQUIREMENTS=${SPARKD__PYTHON_REQUIREMENTS}
- SPARKD_ENTRYPOINT=${SPARKD__SPARKD_ENTRYPOINT}
shm_size: "${SPARKD__SHM_SIZE:-2048mb}"
env_file:
- .env
- ${SPARKD__CONFIG_DIR}/.env
network_mode: "host"
entrypoint: ${SPARKD__MAIN_ENTRYPOINT}
deploy: deploy:
restart_policy: restart_policy:
condition: any condition: any
@@ -106,16 +84,17 @@ services:
resources: resources:
limits: limits:
memory: "${SPARKD__MEMORY:-4gb}" memory: "${SPARKD__MEMORY:-4gb}"
sparkd-tail: sparkd-tail:
image: bluetradingsystems/linux_dotnet8 image: bluetradingsystems/linux_dotnet7
volumes: volumes:
- type: volume - type: volume
read_only: true read_only: true
source: sparkd_data source: sparkd_data
target: /home/bts/.local/share/bts/sparkd/data/logging.sparkd target: /home/bts/sparkdata/data/logging.sparkd
volume: volume:
subpath: logging.sparkd subpath: logging.sparkd
command: ["tail", "-f", "/home/bts/.local/share/bts/sparkd/data/logging.sparkd/log"] command: ["tail", "-f", "/home/bts/sparkdata/data/logging.sparkd/log"]
sparkd-ping-test: sparkd-ping-test:
depends_on: depends_on:
@@ -125,97 +104,11 @@ services:
build: build:
context: . context: .
dockerfile_inline: | dockerfile_inline: |
FROM bluetradingsystems/linux_dotnet8 FROM bluetradingsystems/linux_dotnet7
USER "root" USER "root"
RUN apt-get update && apt-get -y install iputils-ping RUN apt-get update && apt-get -y install iputils-ping
command: [ "ping", "sparkd" ] command: [ "ping", "sparkd" ]
pubsub:
volumes:
- ${PUBSUB__DATA_DIR:-pubsub_data}:/home/bts/.local/share/bts/pubsub/data
build:
dockerfile: src/DataStreamSuite/PubSubServer/Dockerfile
args:
- SOURCE_DIR=${PUBSUB__SOURCE_DIR}
- CONFIG_DIR=${PUBSUB__CONFIG_DIR}
ports:
- 22019:22019
command: >
sh -c "
echo bts | sudo -S chown -R bts:bts /home/bts/.local/share/bts/pubsub/data
if [ -e "/home/bts/.local/share/bts/pubsub/data/logging.PubSubServer/log" ]; then
mv "/home/bts/.local/share/bts/pubsub/data/logging.PubSubServer/log" "/home/bts/.local/share/bts/pubsub/data/logging.PubSubServer/log_$(date '+%Y%m%d-%H%M')"
fi
if [ -e "/home/bts/.local/share/bts/pubsub/conf/.env" ]; then
echo 'Sourcing /home/bts/.local/share/bts/pubsub/conf/.env'
set -a
. /home/bts/.local/share/bts/pubsub/conf/.env
set +a
fi
if [ -e "/home/bts/.local/share/bts/pubsub/conf/.env.local" ]; then
echo 'Sourcing /home/bts/.local/share/bts/pubsub/conf/.env.local'
set -a
. /home/bts/.local/share/bts/pubsub/conf/.env.local
set +a
fi
./PubSubServer"
env_file:
- .env
- ${PUBSUB__CONFIG_DIR}/.env
md-publisher:
volumes:
- ${MD_PUBLISHER__DATA_DIR:-md_publisher_data}:/home/bts/.local/share/bts/md_publisher/data
- historic_md:/home/bts/.local/share/bts/md_publisher/data/databento
build:
dockerfile: src/DataStreamSuite/DataStreamPublisher/Dockerfile
args:
- SOURCE_DIR=${MD_PUBLISHER__SOURCE_DIR}
- CONFIG_DIR=${MD_PUBLISHER__CONFIG_DIR}
command: >
sh -c "
echo bts | sudo -S chown -R bts:bts /home/bts/.local/share/bts/md_publisher/data
if [ -e "/home/bts/.local/share/bts/md_publisher/data/logging.DataStreamPublisher/log" ]; then
mv "/home/bts/.local/share/bts/md_publisher/data/logging.DataStreamPublisher/log" "/home/bts/.local/share/bts/md_publisher/data/logging.DataStreamPublisher/log_$(date '+%Y%m%d-%H%M')"
fi
if [ -e "/home/bts/.local/share/bts/md_publisher/conf/.env" ]; then
echo 'Sourcing /home/bts/.local/share/bts/md_publisher/conf/.env'
set -a
. /home/bts/.local/share/bts/md_publisher/conf/.env
set +a
fi
if [ -e "/home/bts/.local/share/bts/md_publisher/conf/.env.local" ]; then
echo 'Sourcing /home/bts/.local/share/bts/md_publisher/conf/.env.local'
set -a
. /home/bts/.local/share/bts/md_publisher/conf/.env.local
set +a
fi
dockerize -wait tcp://pubsub:22019 -timeout 10s ./DataStreamPublisher"
env_file:
- .env
- ${MD_PUBLISHER__CONFIG_DIR}/.env
api-server:
depends_on:
- sparkd
ports:
- 8008:8008
- 9443:9443
build:
dockerfile: src/client/spark_api_server/Dockerfile
command: [ "dockerize", "-wait", "tcp://sparkd:8000", "-timeout", "10s", "./spark_api_server", "run" ]
environment:
- ASPNETCORE_ENVIRONMENT=Staging
volumes: volumes:
sparkd_data: sparkd_data:
name: "sparkd_${SPARKD__CONFIG_PORT:-8000}" name: "sparkd_${SPARKD__CONFIG_PORT:-8000}"
pubsub_data:
name: "pubsub_22019"
md_publisher_data:
name: "md_publisher_22019"
historic_md:
name: "historic_md"
md_recording:
name: "sparkd_md_recording_${SPARKD__CONFIG_PORT:-8000}"
external: true
@@ -1,39 +0,0 @@
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y pkg-config
RUN apt-get update && apt-get install -y locales
RUN apt-get update && apt-get install -y ca-certificates
RUN apt-get update && apt-get install -y libssh2-1-dev
RUN apt-get update && apt-get install -y software-properties-common
RUN apt-get update && apt-get install -y sudo
RUN apt-get update && apt-get install -y tzdata
# GCC
ARG gcc_major=13
RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get install -y g++-$gcc_major
RUN apt-get update \
&& apt-get install -y dotnet8
RUN locale-gen en_US.UTF-8
ARG docker_user="bts"
ARG docker_uid="1000"
ARG docker_pass="bts"
RUN \
groupadd -g "$docker_uid" "$docker_user" \
&& useradd \
-m \
-u "$docker_uid" \
-g "$docker_uid" \
-G sudo \
--password "$(openssl passwd -1 "$docker_pass")" \
"$docker_user"
USER bts
WORKDIR /home/bts
@@ -1,11 +0,0 @@
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
fish \
less \
vim
USER bts
WORKDIR /home/bts
+3 -3
View File
@@ -18,10 +18,10 @@ MarkupSafe==3.0.2
mccabe==0.6.1 mccabe==0.6.1
numpy==2.2.6 numpy==2.2.6
platformdirs==2.3.0 platformdirs==2.3.0
protobuf==6.33.4 protobuf==4.21.12
pybars3==0.9.7 pybars3==0.9.7
pybind11==3.0.1 pybind11==2.13.6
pybind11-stubgen==2.5.5 pybind11-stubgen==2.5.3
pybit==5.11.0 pybit==5.11.0
pycodestyle==2.7.0 pycodestyle==2.7.0
pycparser==2.20 pycparser==2.20
+118 -281
View File
@@ -1,306 +1,143 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59 VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_api", "src\client\spark_api\spark_api.csproj", "{DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cs", "cs", "{D7C6B9C7-1058-B1EA-FEE6-34C56B05AEDB}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spark", "src\client\spark\Spark.csproj", "{9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Spark.Core", "src\cs\Bts.Spark.Core\Bts.Spark.Core.csproj", "{684863A1-3396-4D31-A731-C0725CF07F4E}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spark.Console", "src\client\Spark.Console\Spark.Console.csproj", "{387566C6-C6F6-412C-A30C-9855BBCB4816}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Spark.Api", "src\cs\Bts.Spark.Api\Bts.Spark.Api.csproj", "{45292808-4EF3-4D4A-B3F5-B75C42EE5870}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_core", "src\client\spark_core\spark_core.csproj", "{6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Extensions.Hosting", "src\cs\Bts.Extensions.Hosting\Bts.Extensions.Hosting.csproj", "{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_sdk", "src\client\spark_sdk\spark_sdk.csproj", "{6963C314-83C4-4667-B0D0-C2F7AE208C29}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.IO.Compression", "src\cs\Bts.IO.Compression\Bts.IO.Compression.csproj", "{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_test", "src\client\spark_test\spark_test.csproj", "{ECD78CC5-138F-4809-A764-2358C2AC2E82}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.Net", "src\cs\Bts.Net\Bts.Net.csproj", "{7543386A-5EBA-4AF0-9E0F-35657B58557D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_websocket", "src\client\spark_websocket\spark_websocket.csproj", "{3201359D-C071-4089-9EDE-B04D759F1508}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataStreamSuite", "DataStreamSuite", "{60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_api_server", "src\client\spark_api_server\spark_api_server.csproj", "{2B8C5D01-FF78-4BFA-B332-5E430586DAF9}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PubSub", "src\DataStreamSuite\PubSub\PubSub.csproj", "{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamCore", "src\DataStreamSuite\DataStreamCore\DataStreamCore.csproj", "{4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamCore", "src\DataStreamSuite\DataStreamCore\DataStreamCore.csproj", "{F7C6F079-67BA-4899-9B43-D3F8C121D264}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStream", "src\DataStreamSuite\DataStream\DataStream.csproj", "{2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArithmeticExpressions", "src\DataStreamSuite\ArithmeticExpressions\ArithmeticExpressions.csproj", "{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedStreams", "src\DataStreamSuite\SharedStreams\SharedStreams.csproj", "{4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseUtilities", "src\DataStreamSuite\BaseUtilities\BaseUtilities.csproj", "{ECBAA198-EC93-4174-8156-BDA5F5E95042}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PubSub", "src\DataStreamSuite\PubSub\PubSub.csproj", "{51C40BA9-F226-4A35-939D-1ED6F5FF7299}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BooleanExpressions", "src\DataStreamSuite\BooleanExpressions\BooleanExpressions.csproj", "{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.ColumnExpressions", "src\DataStreamSuite\Bts.ColumnExpressions\Bts.ColumnExpressions.csproj", "{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bts.ColumnSortExpressions", "src\DataStreamSuite\Bts.ColumnSortExpressions\Bts.ColumnSortExpressions.csproj", "{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamExpressions", "src\DataStreamSuite\DataStreamExpressions\DataStreamExpressions.csproj", "{B6070F41-8759-448B-B56D-A7D15D489569}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStream", "src\DataStreamSuite\DataStream\DataStream.csproj", "{B2D721AB-920C-4CD6-8DBF-6778A115A449}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedStreams", "src\DataStreamSuite\SharedStreams\SharedStreams.csproj", "{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "client", "client", "{C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "spark", "spark", "{42C014A0-00C5-0620-8552-38912E891A7F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spark", "src\client\spark\Spark.csproj", "{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spark_test", "src\client\spark_test\spark_test.csproj", "{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spark.Console", "src\client\Spark.Console\Spark.Console.csproj", "{2B8243FF-60C6-4607-8AAE-7762D29B0A48}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Debug|x86 = Debug|x86 MinSizeRel|x64 = MinSizeRel|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64 Release|x64 = Release|x64
Release|x86 = Release|x86 RelWithDebInfo|x64 = RelWithDebInfo|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{684863A1-3396-4D31-A731-C0725CF07F4E}.Debug|Any CPU.ActiveCfg = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x64.ActiveCfg = Debug|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Debug|Any CPU.Build.0 = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Debug|x64.Build.0 = Debug|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Debug|x64.ActiveCfg = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x64.ActiveCfg = Release|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Debug|x64.Build.0 = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.MinSizeRel|x64.Build.0 = Release|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Debug|x86.ActiveCfg = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.ActiveCfg = Release|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Debug|x86.Build.0 = Debug|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.Release|x64.Build.0 = Release|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Release|Any CPU.ActiveCfg = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Release|Any CPU.Build.0 = Release|x64 {DC9A8975-8211-4FC9-A9BA-C8B9D26AD481}.RelWithDebInfo|x64.Build.0 = Release|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Release|x64.ActiveCfg = Release|x64 {9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.Debug|x64.ActiveCfg = Debug|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Release|x64.Build.0 = Release|x64 {9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.Debug|x64.Build.0 = Debug|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Release|x86.ActiveCfg = Release|x64 {9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.MinSizeRel|x64.ActiveCfg = Release|x64
{684863A1-3396-4D31-A731-C0725CF07F4E}.Release|x86.Build.0 = Release|x64 {9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.MinSizeRel|x64.Build.0 = Release|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Debug|Any CPU.ActiveCfg = Debug|x64 {9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.Release|x64.ActiveCfg = Release|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Debug|Any CPU.Build.0 = Debug|x64 {9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.Release|x64.Build.0 = Release|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Debug|x64.ActiveCfg = Debug|x64 {9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Debug|x64.Build.0 = Debug|x64 {9A4D4D07-1AB6-4B2B-B111-A4F34D6C267E}.RelWithDebInfo|x64.Build.0 = Release|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Debug|x86.ActiveCfg = Debug|x64 {387566C6-C6F6-412C-A30C-9855BBCB4816}.Debug|x64.ActiveCfg = Debug|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Debug|x86.Build.0 = Debug|x64 {387566C6-C6F6-412C-A30C-9855BBCB4816}.Debug|x64.Build.0 = Debug|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Release|Any CPU.ActiveCfg = Release|x64 {387566C6-C6F6-412C-A30C-9855BBCB4816}.MinSizeRel|x64.ActiveCfg = Debug|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Release|Any CPU.Build.0 = Release|x64 {387566C6-C6F6-412C-A30C-9855BBCB4816}.MinSizeRel|x64.Build.0 = Debug|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Release|x64.ActiveCfg = Release|x64 {387566C6-C6F6-412C-A30C-9855BBCB4816}.Release|x64.ActiveCfg = Release|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Release|x64.Build.0 = Release|x64 {387566C6-C6F6-412C-A30C-9855BBCB4816}.Release|x64.Build.0 = Release|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Release|x86.ActiveCfg = Release|x64 {387566C6-C6F6-412C-A30C-9855BBCB4816}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{45292808-4EF3-4D4A-B3F5-B75C42EE5870}.Release|x86.Build.0 = Release|x64 {387566C6-C6F6-412C-A30C-9855BBCB4816}.RelWithDebInfo|x64.Build.0 = Release|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x64.ActiveCfg = Debug|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Debug|Any CPU.Build.0 = Debug|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Debug|x64.Build.0 = Debug|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Debug|x64.ActiveCfg = Debug|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x64.ActiveCfg = Release|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Debug|x64.Build.0 = Debug|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.MinSizeRel|x64.Build.0 = Release|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Debug|x86.ActiveCfg = Debug|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x64.ActiveCfg = Release|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Debug|x86.Build.0 = Debug|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.Release|x64.Build.0 = Release|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Release|Any CPU.ActiveCfg = Release|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Release|Any CPU.Build.0 = Release|Any CPU {6E449EB6-20AC-4FA6-B8D9-10F4BB7E1FEE}.RelWithDebInfo|x64.Build.0 = Release|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Release|x64.ActiveCfg = Release|Any CPU {6963C314-83C4-4667-B0D0-C2F7AE208C29}.Debug|x64.ActiveCfg = Debug|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Release|x64.Build.0 = Release|Any CPU {6963C314-83C4-4667-B0D0-C2F7AE208C29}.Debug|x64.Build.0 = Debug|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Release|x86.ActiveCfg = Release|Any CPU {6963C314-83C4-4667-B0D0-C2F7AE208C29}.MinSizeRel|x64.ActiveCfg = Release|x64
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6}.Release|x86.Build.0 = Release|Any CPU {6963C314-83C4-4667-B0D0-C2F7AE208C29}.MinSizeRel|x64.Build.0 = Release|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6963C314-83C4-4667-B0D0-C2F7AE208C29}.Release|x64.ActiveCfg = Release|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Debug|Any CPU.Build.0 = Debug|Any CPU {6963C314-83C4-4667-B0D0-C2F7AE208C29}.Release|x64.Build.0 = Release|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Debug|x64.ActiveCfg = Debug|Any CPU {6963C314-83C4-4667-B0D0-C2F7AE208C29}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Debug|x64.Build.0 = Debug|Any CPU {6963C314-83C4-4667-B0D0-C2F7AE208C29}.RelWithDebInfo|x64.Build.0 = Release|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Debug|x86.ActiveCfg = Debug|Any CPU {ECD78CC5-138F-4809-A764-2358C2AC2E82}.Debug|x64.ActiveCfg = Debug|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Debug|x86.Build.0 = Debug|Any CPU {ECD78CC5-138F-4809-A764-2358C2AC2E82}.Debug|x64.Build.0 = Debug|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Release|Any CPU.ActiveCfg = Release|Any CPU {ECD78CC5-138F-4809-A764-2358C2AC2E82}.MinSizeRel|x64.ActiveCfg = Debug|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Release|Any CPU.Build.0 = Release|Any CPU {ECD78CC5-138F-4809-A764-2358C2AC2E82}.MinSizeRel|x64.Build.0 = Debug|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Release|x64.ActiveCfg = Release|Any CPU {ECD78CC5-138F-4809-A764-2358C2AC2E82}.Release|x64.ActiveCfg = Release|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Release|x64.Build.0 = Release|Any CPU {ECD78CC5-138F-4809-A764-2358C2AC2E82}.Release|x64.Build.0 = Release|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Release|x86.ActiveCfg = Release|Any CPU {ECD78CC5-138F-4809-A764-2358C2AC2E82}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958}.Release|x86.Build.0 = Release|Any CPU {ECD78CC5-138F-4809-A764-2358C2AC2E82}.RelWithDebInfo|x64.Build.0 = Release|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.ActiveCfg = Debug|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Debug|Any CPU.Build.0 = Debug|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.Debug|x64.Build.0 = Debug|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Debug|x64.ActiveCfg = Debug|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.ActiveCfg = Debug|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Debug|x64.Build.0 = Debug|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.MinSizeRel|x64.Build.0 = Debug|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Debug|x86.ActiveCfg = Debug|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.ActiveCfg = Release|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Debug|x86.Build.0 = Debug|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.Release|x64.Build.0 = Release|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Release|Any CPU.ActiveCfg = Release|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Release|Any CPU.Build.0 = Release|Any CPU {3201359D-C071-4089-9EDE-B04D759F1508}.RelWithDebInfo|x64.Build.0 = Release|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Release|x64.ActiveCfg = Release|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.ActiveCfg = Debug|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Release|x64.Build.0 = Release|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Debug|x64.Build.0 = Debug|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Release|x86.ActiveCfg = Release|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.ActiveCfg = Debug|x64
{7543386A-5EBA-4AF0-9E0F-35657B58557D}.Release|x86.Build.0 = Release|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.MinSizeRel|x64.Build.0 = Debug|x64
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.ActiveCfg = Release|x64
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Debug|Any CPU.Build.0 = Debug|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.Release|x64.Build.0 = Release|x64
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Debug|x64.ActiveCfg = Debug|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Debug|x64.Build.0 = Debug|Any CPU {2B8C5D01-FF78-4BFA-B332-5E430586DAF9}.RelWithDebInfo|x64.Build.0 = Release|x64
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Debug|x86.ActiveCfg = Debug|Any CPU {4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}.Debug|x64.ActiveCfg = Debug|Any CPU
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Debug|x86.Build.0 = Debug|Any CPU {4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}.Debug|x64.Build.0 = Debug|Any CPU
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Release|Any CPU.ActiveCfg = Release|Any CPU {4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Release|Any CPU.Build.0 = Release|Any CPU {4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Release|x64.ActiveCfg = Release|Any CPU {4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}.Release|x64.ActiveCfg = Release|Any CPU
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Release|x64.Build.0 = Release|Any CPU {4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}.Release|x64.Build.0 = Release|Any CPU
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Release|x86.ActiveCfg = Release|Any CPU {4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43}.Release|x86.Build.0 = Release|Any CPU {4E4F491F-C688-43C4-88DA-AC92BC5FA1B8}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}.Debug|x64.ActiveCfg = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Debug|Any CPU.Build.0 = Debug|Any CPU {2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}.Debug|x64.Build.0 = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Debug|x64.ActiveCfg = Debug|Any CPU {2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Debug|x64.Build.0 = Debug|Any CPU {2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Debug|x86.ActiveCfg = Debug|Any CPU {2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}.Release|x64.ActiveCfg = Release|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Debug|x86.Build.0 = Debug|Any CPU {2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}.Release|x64.Build.0 = Release|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Release|Any CPU.ActiveCfg = Release|Any CPU {2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Release|Any CPU.Build.0 = Release|Any CPU {2AC54ADC-3246-427E-9CA9-FEA2DBCB9432}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Release|x64.ActiveCfg = Release|Any CPU {4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}.Debug|x64.ActiveCfg = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Release|x64.Build.0 = Release|Any CPU {4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}.Debug|x64.Build.0 = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Release|x86.ActiveCfg = Release|Any CPU {4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{F7C6F079-67BA-4899-9B43-D3F8C121D264}.Release|x86.Build.0 = Release|Any CPU {4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}.Release|x64.ActiveCfg = Release|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Debug|Any CPU.Build.0 = Debug|Any CPU {4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}.Release|x64.Build.0 = Release|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Debug|x64.ActiveCfg = Debug|Any CPU {4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Debug|x64.Build.0 = Debug|Any CPU {4E96E5CC-7791-40B3-A8A1-C34FBB736B3B}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Debug|x86.ActiveCfg = Debug|Any CPU {51C40BA9-F226-4A35-939D-1ED6F5FF7299}.Debug|x64.ActiveCfg = Debug|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Debug|x86.Build.0 = Debug|Any CPU {51C40BA9-F226-4A35-939D-1ED6F5FF7299}.Debug|x64.Build.0 = Debug|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Release|Any CPU.ActiveCfg = Release|Any CPU {51C40BA9-F226-4A35-939D-1ED6F5FF7299}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Release|Any CPU.Build.0 = Release|Any CPU {51C40BA9-F226-4A35-939D-1ED6F5FF7299}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Release|x64.ActiveCfg = Release|Any CPU {51C40BA9-F226-4A35-939D-1ED6F5FF7299}.Release|x64.ActiveCfg = Release|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Release|x64.Build.0 = Release|Any CPU {51C40BA9-F226-4A35-939D-1ED6F5FF7299}.Release|x64.Build.0 = Release|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Release|x86.ActiveCfg = Release|Any CPU {51C40BA9-F226-4A35-939D-1ED6F5FF7299}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7}.Release|x86.Build.0 = Release|Any CPU {51C40BA9-F226-4A35-939D-1ED6F5FF7299}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Debug|x64.ActiveCfg = Debug|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Debug|x64.Build.0 = Debug|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Debug|x86.ActiveCfg = Debug|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Debug|x86.Build.0 = Debug|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Release|Any CPU.Build.0 = Release|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Release|x64.ActiveCfg = Release|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Release|x64.Build.0 = Release|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Release|x86.ActiveCfg = Release|Any CPU
{ECBAA198-EC93-4174-8156-BDA5F5E95042}.Release|x86.Build.0 = Release|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Debug|x64.ActiveCfg = Debug|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Debug|x64.Build.0 = Debug|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Debug|x86.ActiveCfg = Debug|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Debug|x86.Build.0 = Debug|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Release|Any CPU.Build.0 = Release|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Release|x64.ActiveCfg = Release|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Release|x64.Build.0 = Release|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Release|x86.ActiveCfg = Release|Any CPU
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40}.Release|x86.Build.0 = Release|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Debug|x64.ActiveCfg = Debug|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Debug|x64.Build.0 = Debug|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Debug|x86.ActiveCfg = Debug|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Debug|x86.Build.0 = Debug|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Release|Any CPU.Build.0 = Release|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Release|x64.ActiveCfg = Release|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Release|x64.Build.0 = Release|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Release|x86.ActiveCfg = Release|Any CPU
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7}.Release|x86.Build.0 = Release|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Debug|x64.ActiveCfg = Debug|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Debug|x64.Build.0 = Debug|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Debug|x86.ActiveCfg = Debug|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Debug|x86.Build.0 = Debug|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Release|Any CPU.Build.0 = Release|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Release|x64.ActiveCfg = Release|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Release|x64.Build.0 = Release|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Release|x86.ActiveCfg = Release|Any CPU
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60}.Release|x86.Build.0 = Release|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Debug|x64.ActiveCfg = Debug|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Debug|x64.Build.0 = Debug|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Debug|x86.ActiveCfg = Debug|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Debug|x86.Build.0 = Debug|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Release|Any CPU.Build.0 = Release|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Release|x64.ActiveCfg = Release|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Release|x64.Build.0 = Release|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Release|x86.ActiveCfg = Release|Any CPU
{B6070F41-8759-448B-B56D-A7D15D489569}.Release|x86.Build.0 = Release|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Debug|x64.ActiveCfg = Debug|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Debug|x64.Build.0 = Debug|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Debug|x86.ActiveCfg = Debug|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Debug|x86.Build.0 = Debug|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Release|Any CPU.Build.0 = Release|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Release|x64.ActiveCfg = Release|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Release|x64.Build.0 = Release|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Release|x86.ActiveCfg = Release|Any CPU
{B2D721AB-920C-4CD6-8DBF-6778A115A449}.Release|x86.Build.0 = Release|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Debug|x64.ActiveCfg = Debug|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Debug|x64.Build.0 = Debug|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Debug|x86.ActiveCfg = Debug|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Debug|x86.Build.0 = Debug|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Release|Any CPU.Build.0 = Release|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Release|x64.ActiveCfg = Release|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Release|x64.Build.0 = Release|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Release|x86.ActiveCfg = Release|Any CPU
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20}.Release|x86.Build.0 = Release|Any CPU
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Debug|Any CPU.ActiveCfg = Debug|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Debug|Any CPU.Build.0 = Debug|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Debug|x64.ActiveCfg = Debug|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Debug|x64.Build.0 = Debug|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Debug|x86.ActiveCfg = Debug|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Debug|x86.Build.0 = Debug|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Release|Any CPU.ActiveCfg = Release|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Release|Any CPU.Build.0 = Release|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Release|x64.ActiveCfg = Release|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Release|x64.Build.0 = Release|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Release|x86.ActiveCfg = Release|x64
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3}.Release|x86.Build.0 = Release|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Debug|Any CPU.ActiveCfg = Debug|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Debug|Any CPU.Build.0 = Debug|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Debug|x64.ActiveCfg = Debug|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Debug|x64.Build.0 = Debug|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Debug|x86.ActiveCfg = Debug|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Debug|x86.Build.0 = Debug|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Release|Any CPU.ActiveCfg = Release|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Release|Any CPU.Build.0 = Release|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Release|x64.ActiveCfg = Release|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Release|x64.Build.0 = Release|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Release|x86.ActiveCfg = Release|x64
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224}.Release|x86.Build.0 = Release|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Debug|Any CPU.ActiveCfg = Debug|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Debug|Any CPU.Build.0 = Debug|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Debug|x64.ActiveCfg = Debug|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Debug|x64.Build.0 = Debug|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Debug|x86.ActiveCfg = Debug|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Debug|x86.Build.0 = Debug|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Release|Any CPU.ActiveCfg = Release|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Release|Any CPU.Build.0 = Release|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Release|x64.ActiveCfg = Release|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Release|x64.Build.0 = Release|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Release|x86.ActiveCfg = Release|x64
{2B8243FF-60C6-4607-8AAE-7762D29B0A48}.Release|x86.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(ExtensibilityGlobals) = postSolution
{D7C6B9C7-1058-B1EA-FEE6-34C56B05AEDB} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} SolutionGuid = {422D1620-0166-4C26-9A81-CA8A2EB1AB58}
{684863A1-3396-4D31-A731-C0725CF07F4E} = {D7C6B9C7-1058-B1EA-FEE6-34C56B05AEDB} EndGlobalSection
{45292808-4EF3-4D4A-B3F5-B75C42EE5870} = {D7C6B9C7-1058-B1EA-FEE6-34C56B05AEDB} GlobalSection(Performance) = preSolution
{AA57F8D9-7BD6-4161-881B-AD2CEF9A30F6} = {D7C6B9C7-1058-B1EA-FEE6-34C56B05AEDB} HasPerformanceSessions = true
{28A26DF7-5F7A-43A2-A548-B55FEBCC3958} = {D7C6B9C7-1058-B1EA-FEE6-34C56B05AEDB}
{7543386A-5EBA-4AF0-9E0F-35657B58557D} = {D7C6B9C7-1058-B1EA-FEE6-34C56B05AEDB}
{60E0D592-FFB3-0D0A-C4AA-E88919B48F9D} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{C13A5ABD-F739-4BE8-A2FE-511E989A5B43} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{F7C6F079-67BA-4899-9B43-D3F8C121D264} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{E60C119D-2919-4E2F-9D39-90DB1A8FF9A7} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{ECBAA198-EC93-4174-8156-BDA5F5E95042} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{F54AE5C0-2ECA-4151-82E6-0D7EFE88FF40} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{A898C6C3-F134-4AF0-AFB3-3834C58CC0D7} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{1E296FB3-D185-4A95-A1EB-AA5B37B85C60} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{B6070F41-8759-448B-B56D-A7D15D489569} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{B2D721AB-920C-4CD6-8DBF-6778A115A449} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{38EE36C6-892C-4C94-8BB0-1ACB164E1F20} = {60E0D592-FFB3-0D0A-C4AA-E88919B48F9D}
{C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{42C014A0-00C5-0620-8552-38912E891A7F} = {C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}
{D432F3E9-3D2F-4623-B7B9-CEBA6701FFC3} = {42C014A0-00C5-0620-8552-38912E891A7F}
{DD00F5D5-6C2F-4FDA-AE3D-25CF01A9A224} = {C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}
{2B8243FF-60C6-4607-8AAE-7762D29B0A48} = {C5A3B5EA-BE9F-76E5-E9B8-8A22B289B295}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal
@@ -8,6 +8,7 @@
public int Integer; public int Integer;
public double Real; public double Real;
public string Identifier; public string Identifier;
public DateTime DateTime;
public ImmutableList<IArithmeticExpression> Arguments; public ImmutableList<IArithmeticExpression> Arguments;
public ImmutableList<Assignment> Assignments; public ImmutableList<Assignment> Assignments;
public IArithmeticExpression Argument; public IArithmeticExpression Argument;
@@ -11,20 +11,10 @@
<PackageReference Include="YaccLexTools" Version="1.2.2" /> <PackageReference Include="YaccLexTools" Version="1.2.2" />
</ItemGroup> </ItemGroup>
<Choose> <ItemGroup>
<When Condition="'$(UseProjectRefs)' == 'true'"> <ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" />
<ItemGroup> <ProjectReference Include="..\..\client\spark_core\spark_core.csproj" />
<ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" /> </ItemGroup>
<ProjectReference Include="..\..\cs\Bts.Spark.Core\Bts.Spark.Core.csproj" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="ExpressionCore" Version="$(SparkVersion)" />
<PackageReference Include="Bts.Spark.Core" Version="$(SparkVersion)" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup Label="ArithmeticExpression"> <ItemGroup Label="ArithmeticExpression">
<Scanner Include="ArithmeticExpressionTokens.lex" /> <Scanner Include="ArithmeticExpressionTokens.lex" />
@@ -5,5 +5,9 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\client\spark_core\spark_core.csproj" />
</ItemGroup>
</Project> </Project>
@@ -1,6 +1,4 @@
using System; using System;
using System.Runtime.Versioning;
using Microsoft.Win32; using Microsoft.Win32;
namespace BCG namespace BCG
@@ -12,7 +10,6 @@ namespace BCG
rk.SetValue (name, value.ToString ()); rk.SetValue (name, value.ToString ());
} }
[SupportedOSPlatform("windows")]
public static double getValue (RegistryKey rk, string name) public static double getValue (RegistryKey rk, string name)
{ {
object v = rk.GetValue (name); object v = rk.GetValue (name);
@@ -6,80 +6,23 @@ using Spark.Core.Collections;
static class ArgumentComparer { static class ArgumentComparer {
public static int Compare( public static int Compare(
IArgument value1, IArgument value2, IDictionary<string, object?> env) { IArgument value1, IArgument value2, IDictionary<string,object?> env) {
if (value1 is null) { if (value1 is null) {
throw new ArgumentNullException(nameof(value1)); throw new ArgumentNullException(nameof(value1));
} }
if (value2 is null) { if (value2 is null) {
throw new ArgumentNullException(nameof(value2)); throw new ArgumentNullException(nameof(value2));
} }
var obj1 = value1.GetValue(env); var cmp1 = value1.Cast<IComparable>();
var obj2 = value2.GetValue(env); var cmp2 = value2.Cast<IComparable>();
if (obj1 is null) {
if (obj2 is null) {
return 0;
}
return -1;
}
if (obj2 is null) {
return 1;
}
return compareObjs(obj1, obj2);
}
static int compareObjs(object obj1, object obj2) {
try { try {
var typ1 = obj1.GetType(); var v1 = cmp1.GetValue(env);
var typ2 = obj2.GetType(); var v2 = cmp2.GetValue(env);
bool areSameTypes = typ1 == typ2; return v1.GetType().IsNumeric() ?
if (areSameTypes) { new NumericComparer().Compare(v1, v2) : v1.CompareTo(v2);
return ((IComparable)obj1).CompareTo(obj2);
}
if (typ1.IsNumeric()) {
return tryCompareNumeric(obj1, obj2);
} else if (typ2.IsNumeric()) {
return -tryCompareNumeric(obj2, obj1);
} else if (typ1.IsEnum) {
if (typ2 == typeof(string)) {
return -((string)obj2).CompareTo(obj1.ToString());
}
} else if (typ1 == typeof(string)) {
return ((string)obj1).CompareTo(obj2.ToString());
} else if (typ1 == typeof(DateTime)) {
if (typ2 == typeof(TimeSpan)) {
return ((DateTime)obj1).Ticks.CompareTo(((TimeSpan)obj2).Ticks);
}
} else if (typ1 == typeof(TimeSpan)) {
if (typ2 == typeof(DateTime)) {
return ((TimeSpan)obj1).Ticks.CompareTo(((DateTime)obj2).Ticks);
}
}
} catch (Exception ex) { } catch (Exception ex) {
Log.Ui.error($"Comparison failed: {ex}"); Log.Ui.error($"Comparison failed: {ex}");
throw; throw;
} }
throw new ArgumentException("Failed to compare obj1 and obj2", nameof(obj1));
}
static int tryCompareNumeric(object numericObj1, object obj2) {
var typ2 = obj2.GetType();
if (typ2.IsNumeric()) {
return new NumericComparer().Compare(numericObj1, obj2);
} else if (typ2.IsEnum) {
var undTyp2 = typ2.GetEnumUnderlyingType();
if (undTyp2 == typeof(byte)) {
return new NumericComparer().Compare(numericObj1, (byte)obj2);
}
if (undTyp2 == typeof(short)) {
return new NumericComparer().Compare(numericObj1, (short)obj2);
}
if (undTyp2 == typeof(int)) {
return new NumericComparer().Compare(numericObj1, (int)obj2);
}
if (undTyp2 == typeof(long)) {
return new NumericComparer().Compare(numericObj1, (long)obj2);
}
}
throw new ArgumentException("Failed to compare numeric obj1 and obj2", nameof(obj2));
} }
} }
@@ -1,11 +1,19 @@
namespace Bts.BooleanExpressions; namespace Bts.BooleanExpressions;
using bts;
class BooleanExpression : IBooleanExpression { class BooleanExpression : IBooleanExpression {
readonly Func<IDictionary<string, object?>, bool> evaluate; readonly Func<IDictionary<string, object?>, bool> evaluate;
public BooleanExpression(Func<IDictionary<string, object?>, bool> evaluate) => public BooleanExpression(Func<IDictionary<string, object?>, bool> evaluate) =>
this.evaluate = evaluate; this.evaluate = evaluate;
public bool Evaluate(IDictionary<string, object?> env) => public bool Evaluate(IDictionary<string, object?> env) {
evaluate(env); try {
return evaluate(env);
} catch (Exception ex) {
Log.assert(false, $"BooleanExpression.Evaluate failed: {ex}");
throw;
}
}
} }
@@ -47,6 +47,11 @@ IsOfType '/'
%% %%
{StringConstant} {
yylval.String = yytext.Substring(1, yytext.Length - 2).Replace(@"\'", "'");
return (int)Token.STRING_CONSTANT;
}
{BooleanConstant} { {BooleanConstant} {
yylval.Boolean = yytext.ToLower() switch { yylval.Boolean = yytext.ToLower() switch {
"true" => true, "true" => true,
@@ -57,11 +62,6 @@ IsOfType '/'
return (int)Token.BOOLEAN_CONSTANT; return (int)Token.BOOLEAN_CONSTANT;
} }
{StringConstant} {
yylval.String = yytext.Substring(1, yytext.Length - 2).Replace(@"\'", "'");
return (int)Token.STRING_CONSTANT;
}
{NullConstant} { {NullConstant} {
yylval.Null = DBNull.Value; yylval.Null = DBNull.Value;
return (int)Token.NULL_CONSTANT; return (int)Token.NULL_CONSTANT;
@@ -11,20 +11,10 @@
<PackageReference Include="YaccLexTools" Version="1.2.3" /> <PackageReference Include="YaccLexTools" Version="1.2.3" />
</ItemGroup> </ItemGroup>
<Choose> <ItemGroup>
<When Condition="'$(UseProjectRefs)' == 'true'"> <ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" />
<ItemGroup> <ProjectReference Include="..\..\client\spark_core\spark_core.csproj" />
<ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" /> </ItemGroup>
<ProjectReference Include="..\..\cs\Bts.Spark.Core\Bts.Spark.Core.csproj" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="ExpressionCore" Version="$(SparkVersion)" />
<PackageReference Include="Bts.Spark.Core" Version="$(SparkVersion)" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup> <ItemGroup>
<Scanner Include="BooleanExpressionTokens.lex" /> <Scanner Include="BooleanExpressionTokens.lex" />
@@ -10,20 +10,11 @@
<PackageReference Include="YaccLexTools" Version="1.2.2" /> <PackageReference Include="YaccLexTools" Version="1.2.2" />
</ItemGroup> </ItemGroup>
<Choose> <ItemGroup>
<When Condition="'$(UseProjectRefs)' == 'true'"> <ProjectReference Include="..\DataStreamCore\DataStreamCore.csproj" />
<ItemGroup> <ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" />
<ProjectReference Include="..\DataStreamCore\DataStreamCore.csproj" /> <ProjectReference Include="..\..\client\spark_core\spark_core.csproj" />
<ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" /> </ItemGroup>
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="DataStreamCore" Version="$(SparkVersion)" />
<PackageReference Include="ExpressionCore" Version="$(SparkVersion)" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup Label="ColumnExpression"> <ItemGroup Label="ColumnExpression">
<Scanner Include="ColumnExpressionTokens.lex" /> <Scanner Include="ColumnExpressionTokens.lex" />
@@ -10,20 +10,11 @@
<PackageReference Include="YaccLexTools" Version="1.2.2" /> <PackageReference Include="YaccLexTools" Version="1.2.2" />
</ItemGroup> </ItemGroup>
<Choose> <ItemGroup>
<When Condition="'$(UseProjectRefs)' == 'true'"> <ProjectReference Include="..\DataStreamCore\DataStreamCore.csproj" />
<ItemGroup> <ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" />
<ProjectReference Include="..\DataStreamCore\DataStreamCore.csproj" /> <ProjectReference Include="..\..\client\spark_core\spark_core.csproj" />
<ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" /> </ItemGroup>
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="DataStreamCore" Version="$(SparkVersion)" />
<PackageReference Include="ExpressionCore" Version="$(SparkVersion)" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup Label="ColumnSortExpression"> <ItemGroup Label="ColumnSortExpression">
<Scanner Include="ColumnSortExpressionTokens.lex" /> <Scanner Include="ColumnSortExpressionTokens.lex" />
@@ -7,21 +7,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.24.3" />
<PackageReference Include="YaccLexTools" Version="1.2.2" /> <PackageReference Include="YaccLexTools" Version="1.2.2" />
</ItemGroup> </ItemGroup>
<Choose> <ItemGroup>
<When Condition="'$(UseProjectRefs)' == 'true'"> <ProjectReference Include="..\DataStreamCore\DataStreamCore.csproj" />
<ItemGroup> <ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" />
<ProjectReference Include="..\ExpressionCore\ExpressionCore.csproj" /> <ProjectReference Include="..\..\client\spark_core\spark_core.csproj" />
</ItemGroup> </ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="ExpressionCore" Version="$(SparkVersion)" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup Label="ColumnMapExpression"> <ItemGroup Label="ColumnMapExpression">
<Scanner Include="ColumnMapExpressionTokens.lex" /> <Scanner Include="ColumnMapExpressionTokens.lex" />
@@ -1,18 +0,0 @@
namespace bts.BlueOrb {
using System;
using BCG;
[DataStreamUserRespresentation("CSVReaderStream")]
public class CSVReaderStream : ViewStream {
public CSVReaderStream(string file_name)
: this(file_name, false) { }
public CSVReaderStream(string file_name, bool guess_schema) {
ViewStream rs = new BCG.CSVReaderStream(file_name);
if (guess_schema) {
rs = new SchemaGuesserStream(rs);
}
mySetRealSource(rs);
}
}
}
@@ -1,13 +0,0 @@
namespace bts.BlueOrb {
using BCG;
using System;
[DataStreamUserRespresentation("CSVSaverStream")]
public class CSVSaverStream: ViewStream {
public CSVSaverStream(ViewStream parent_str, string file_name) {
BCG.CSVSaverStream rs = new BCG.CSVSaverStream(parent_str, file_name, true, Int32.MaxValue, false);
mySetRealSource(rs);
}
}
}
@@ -1,7 +1,9 @@
using System;
namespace BCG { namespace BCG {
[DataStreamUserRespresentation("CountStream")] [DataStreamUserRespresentation("CountStream")]
public class CountStream : ViewStream { public class CountStream : ViewStream {
IDataPacket? myLastFiredDataPacket; private DataPacket myLastFiredDataPacket;
private IBlueTableSchema mySchema = new BlueTableSchema("count", private IBlueTableSchema mySchema = new BlueTableSchema("count",
new ColumnInfo("id", 0, typeof(int)), new ColumnInfo("id", 0, typeof(int)),
new ColumnInfo("count", 1, typeof(int))); new ColumnInfo("count", 1, typeof(int)));
@@ -22,6 +24,7 @@ namespace BCG {
myVS.onChange -= new ChangeDelegate(myHandleChanges); myVS.onChange -= new ChangeDelegate(myHandleChanges);
} }
private void myHandleChanges(object newValue) { private void myHandleChanges(object newValue) {
myFireEvent( myFireEvent(
myLastFiredDataPacket = myLastFiredDataPacket =
@@ -36,8 +39,11 @@ namespace BCG {
private IBlueRowCollection myGetRows(object dp, int id) { private IBlueRowCollection myGetRows(object dp, int id) {
BlueTable retVal = new BlueTable(mySchema); BlueTable retVal = new BlueTable(mySchema);
retVal.addRow(new BlueRow(mySchema, id, ((IDataPacket)dp).newRows.Count)); retVal.addRow
(new BlueRow(mySchema, id, (dp as DataPacket).newRows.Count));
return retVal; return retVal;
} }
} }
} }
@@ -15,7 +15,6 @@ namespace bts.BlueOrb {
rv = rv.add_column(System.TypeCode.Int32, $"{inp_col}_hour"); rv = rv.add_column(System.TypeCode.Int32, $"{inp_col}_hour");
rv = rv.add_column(System.TypeCode.Int32, $"{inp_col}_minute"); rv = rv.add_column(System.TypeCode.Int32, $"{inp_col}_minute");
rv = rv.add_column(System.TypeCode.Int32, $"{inp_col}_seconds_of_day"); rv = rv.add_column(System.TypeCode.Int32, $"{inp_col}_seconds_of_day");
rv = rv.add_column(System.TypeCode.Int32, $"{inp_col}_year");
return rv; return rv;
}; };
ViewStream rs = new MapStream(parent_stream, ViewStream rs = new MapStream(parent_stream,
@@ -31,7 +30,6 @@ namespace bts.BlueOrb {
rv.setValue($"{inp_col}_hour", dt.Hour); rv.setValue($"{inp_col}_hour", dt.Hour);
rv.setValue($"{inp_col}_minute", dt.Minute); rv.setValue($"{inp_col}_minute", dt.Minute);
rv.setValue($"{inp_col}_seconds_of_day", (dt - dt.Date).TotalSeconds); rv.setValue($"{inp_col}_seconds_of_day", (dt - dt.Date).TotalSeconds);
rv.setValue($"{inp_col}_year", dt.Date.Year);
return rv; return rv;
}); });
mySetRealSource(rs); mySetRealSource(rs);
@@ -1,8 +1,5 @@
namespace bts.BlueOrb { namespace bts.BlueOrb {
using BCG; using BCG;
using Bts.DataStreamCore;
using System; using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@@ -24,24 +21,22 @@ namespace bts.BlueOrb {
#region IStreamFilter Members #region IStreamFilter Members
public bool filter(IBlueRow dr) { public bool filter(IBlueRow dr) {
bool rv = true;
for (int i = 0; i < myCols.Length; i++) { for (int i = 0; i < myCols.Length; i++) {
var val = dr[myCols[i]]; rv &= myRegExps[i].IsMatch(dr[myCols[i]] is DBNull ? "" : dr[myCols[i]].ToString());
var str = val is DBNull if (!rv)
? string.Empty return rv;
: (val?.ToString() ?? string.Empty);
if (!myRegExps[i].IsMatch(str)) {
return false;
}
} }
return true; return rv;
} }
#endregion #endregion
} }
BlueTable? myLastFiredRows; private BlueTable myLastFiredRows;
IBlueRowCollection? myLastReceivedRows; private IBlueRowCollection myLastReceivedRows;
private IStreamFilter myFilter; private IStreamFilter myFilter;
private ViewStream myParentStream; private ViewStream myParentStream;
private string myFilterString; private string myFilterString;
private bool myUseNewFilter = false;// Configuration.get<DataStreamConfig>().UseNewFilter;
#region constructors #region constructors
public delegate bool OnFilter(IBlueRow r); public delegate bool OnFilter(IBlueRow r);
@@ -57,11 +52,12 @@ namespace bts.BlueOrb {
public FilterStream(ViewStream vs, IStreamFilter filter) { public FilterStream(ViewStream vs, IStreamFilter filter) {
myParentStream = vs; {
myFilter = filter; myParentStream = vs;
myFilterString = filter.ToString() ?? string.Empty; myFilter = filter;
if (filter is IDynamicStreamFilter dynFilter) { myFilterString = filter.ToString();
dynFilter.onFilterChange += myHandleFilterChange; if (filter is IDynamicStreamFilter)
(filter as IDynamicStreamFilter).onFilterChange += new FilterChangeDelegate(myHandleFilterChange);
} }
} }
@@ -90,7 +86,7 @@ namespace bts.BlueOrb {
} }
protected override void myFireEvent(object o) { protected override void myFireEvent(object o) {
var dp = (IDataPacket)o; DataPacket dp = o as DataPacket;
if (myLastValue == null || dp.addedRows.Count + dp.deletedRows.Count > 0) if (myLastValue == null || dp.addedRows.Count + dp.deletedRows.Count > 0)
base.myFireEvent(o); base.myFireEvent(o);
} }
@@ -98,27 +94,23 @@ namespace bts.BlueOrb {
private void myHandleCallbacks(object newValue) { private void myHandleCallbacks(object newValue) {
DataPacket retVal; DataPacket retVal;
IDataPacket arrivedPacket = (IDataPacket)newValue; DataPacket arrivedPacket = newValue as DataPacket;
myLastReceivedRows = arrivedPacket.newRows; myLastReceivedRows = arrivedPacket.newRows;
if (myLastFiredRows != null) { if (myLastFiredRows != null) {
retVal = new DataPacket(myLastFiredRows, new BlueTable(myLastFiredRows.schema), retVal = new DataPacket(myLastFiredRows, new BlueTable(myLastFiredRows.schema),
new BlueTable(myLastFiredRows.schema)); new BlueTable(myLastFiredRows.schema));
var deletedRows = new Lazy<BlueTable>(() => (BlueTable)retVal.deletedRows); foreach (IBlueRow r in arrivedPacket.deletedRows)
foreach (IBlueRow r in arrivedPacket.deletedRows) { if (myLastFiredRows.containsID((int)r["id"])) {
if (myLastFiredRows.containsID(r.Id())) {
myLastFiredRows.deleteRow(r); myLastFiredRows.deleteRow(r);
deletedRows.Value.addRow(r); (retVal.deletedRows as BlueTable).addRow(r);
} }
} foreach (IBlueRow r in arrivedPacket.addedRows)
var addedRows = new Lazy<BlueTable>(() => (BlueTable)retVal.addedRows);
foreach (IBlueRow r in arrivedPacket.addedRows) {
if (myFilter.filter(r)) { if (myFilter.filter(r)) {
myLastFiredRows.addRow(r); myLastFiredRows.addRow(r);
addedRows.Value.addRow(r); (retVal.addedRows as BlueTable).addRow(r);
} }
}
} else { } else {
myLastFiredRows = new BlueTable(arrivedPacket.Schema); myLastFiredRows = new BlueTable(arrivedPacket.schema);
retVal = new DataPacket(myLastFiredRows, myLastFiredRows, new BlueTable(myLastFiredRows.schema)); retVal = new DataPacket(myLastFiredRows, myLastFiredRows, new BlueTable(myLastFiredRows.schema));
foreach (IBlueRow r in arrivedPacket.newRows) foreach (IBlueRow r in arrivedPacket.newRows)
if (myFilter.filter(r)) if (myFilter.filter(r))
@@ -1,13 +1,12 @@
using BCG; using System;
using Bts.DataStreamCore;
using Spark.Core.Diagnostics;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text.Json;
using bts;
//using bts.SilverPine;
using BCG;
namespace bts.BlueOrb { namespace bts.BlueOrb {
[DataStreamUserRespresentation("GroupByStream")] [DataStreamUserRespresentation("GroupByStream")]
@@ -15,45 +14,41 @@ namespace bts.BlueOrb {
public interface INonIncGroupByEvaluator { public interface INonIncGroupByEvaluator {
// grouped_rows // grouped_rows
IBlueRowCollection? evaluate(IDictionary<int, List<IBlueRow>> grouped_rows); IBlueRowCollection evaluate(IDictionary<int, List<IBlueRow>> grouped_rows);
string[]? get_group_by_cols(); string[] get_group_by_cols();
} }
private class DelNonIncGroupByEvaluator : INonIncGroupByEvaluator { private class DelNonIncGroupByEvaluator : INonIncGroupByEvaluator {
Func<string[]?> _groupby_cols_func; Func<string[]> _groupby_cols_func;
Func<List<IBlueRow>, List<IBlueRow>> _evaluate_func; Func<List<IBlueRow>, List<IBlueRow>> _evaluate_func;
public DelNonIncGroupByEvaluator(Func<string[]?> groupby_cols_func, public DelNonIncGroupByEvaluator(Func<string[]> groupby_cols_func,
Func<List<IBlueRow>, List<IBlueRow>> evaluate_func) { Func<List<IBlueRow>, List<IBlueRow>> evaluate_func) {
_groupby_cols_func = groupby_cols_func; _groupby_cols_func = groupby_cols_func;
_evaluate_func = evaluate_func; _evaluate_func = evaluate_func;
} }
public IBlueRowCollection evaluate(IDictionary<int, List<IBlueRow>> grouped_rows) {
public IBlueRowCollection? evaluate(IDictionary<int, List<IBlueRow>> grouped_rows) { BlueTable rv = null;
BlueTable? rv = null;
foreach (var kv in grouped_rows) { foreach (var kv in grouped_rows) {
List<IBlueRow> g_rows = kv.Value; List<IBlueRow> g_rows = kv.Value;
List<IBlueRow> out_rows = _evaluate_func.Invoke(g_rows); List<IBlueRow> out_rows = _evaluate_func.Invoke(g_rows);
if (out_rows != null && out_rows.Count > 0) { if (out_rows != null && out_rows.Count > 0) {
rv = rv ?? new BlueTable(out_rows.ElementAt(0).schema); rv = rv ?? new BlueTable(out_rows.ElementAt(0).schema);
} }
if (rv != null) rv.addRows(out_rows);
rv.addRows(out_rows);
} }
return rv; return rv;
} }
public string[] get_group_by_cols() {
public string[]? get_group_by_cols() {
return _groupby_cols_func(); return _groupby_cols_func();
} }
} }
ViewStream? _main_stream; private ViewStream _main_stream;
INonIncGroupByEvaluator? _groupby_func; private INonIncGroupByEvaluator _groupby_func;
BlueRowHasher? _row_hasher; private BlueRowHasher _row_hasher;
string[]? _groupby_cols; private string[] _groupby_cols;
private Stopwatch _timer = new(); private Stopwatch _timer = new();
private int _n_total_fires = 0, _n_expensive_fires = 0; private int _n_total_fires = 0, _n_expensive_fires = 0;
IDisposable? subscription;
public GroupByStream(ViewStream main_stream, INonIncGroupByEvaluator groupby_func) { public GroupByStream(ViewStream main_stream, INonIncGroupByEvaluator groupby_func) {
_main_stream = main_stream; _main_stream = main_stream;
@@ -62,52 +57,40 @@ namespace bts.BlueOrb {
_row_hasher = new BlueRowHasher(_groupby_cols == null ? 0 : _groupby_cols.Length); _row_hasher = new BlueRowHasher(_groupby_cols == null ? 0 : _groupby_cols.Length);
} }
public GroupByStream(ViewStream main_stream, Func<string[]?> groupby_cols_func, public GroupByStream(ViewStream main_stream, Func<string[]> groupby_cols_func,
Func<List<IBlueRow>, List<IBlueRow>> evaluate_func) Func<List<IBlueRow>, List<IBlueRow>> evaluate_func)
: this(main_stream, new DelNonIncGroupByEvaluator(groupby_cols_func, evaluate_func)) { } : this(main_stream, new DelNonIncGroupByEvaluator(groupby_cols_func, evaluate_func)) { }
public GroupByStream(ViewStream parent_str, string groupby_cols, string standard_group_by_text) public GroupByStream(ViewStream parent_str, string groupby_col, string standard_group_by_text)
: this(parent_str, groupby_cols, standard_group_by_text, String.Empty) { } : this(parent_str, groupby_col, standard_group_by_text, String.Empty) { }
// this is the main constructor that does everything // this is the main constructor that does everything
public GroupByStream(ViewStream parent_str, string groupby_cols, string standard_group_by_ops, string optional_sort_col) { public GroupByStream(ViewStream parent_str, string groupby_col, string standard_group_by_ops, string optional_sort_col) {
MultiRowOpHelper std_group_by = MultiRowOpHelper.parse_ops(standard_group_by_ops); MultiRowOpHelper std_group_by = MultiRowOpHelper.parse_ops(standard_group_by_ops);
Func<string[]> groupby_cols_func = () => {
return String.IsNullOrEmpty(groupby_col) ? null : new string[] { groupby_col };
};
Func<List<IBlueRow>, List<IBlueRow>> evaluate_func = (group_rows) => { Func<List<IBlueRow>, List<IBlueRow>> evaluate_func = (group_rows) => {
if (!String.IsNullOrEmpty(optional_sort_col)) if (!String.IsNullOrEmpty(optional_sort_col))
group_rows.Sort((r1, r2) => BlueDataUtility.compare_rows(r2, r1, optional_sort_col)); group_rows.Sort((r1, r2) => BlueDataUtility.compare_rows(r2, r1, optional_sort_col));
// this si where the group by aggregation happens // this si where the group by aggregation happens
IBlueRow? rv = MultiRowOpHelper.group_by_compute(group_rows, std_group_by); IBlueRow rv = MultiRowOpHelper.group_by_compute(group_rows, std_group_by);
if (rv == null)
return new List<IBlueRow>();
return new IBlueRow[] { rv }.ToList(); return new IBlueRow[] { rv }.ToList();
}; };
ViewStream rs = new GroupByStream(parent_str, groupby_cols_func, evaluate_func); ViewStream rs = new GroupByStream(parent_str, groupby_cols_func, evaluate_func);
mySetRealSource(rs); mySetRealSource(rs);
string[]? groupby_cols_func() {
if (string.IsNullOrEmpty(groupby_cols)) {
return null;
}
return groupby_cols.Split(',').Select(x => x.Trim()).ToArray();
}
} }
public GroupByStream(ViewStream parent_str, string standard_group_by_text) : public GroupByStream(ViewStream parent_str, string standard_group_by_text) :
this(parent_str, String.Empty, standard_group_by_text) { this(parent_str, String.Empty, standard_group_by_text) {
} }
protected override void myOnFirstSubscriber() {
Log.isnull(subscription);
subscription = ExceptionAssert.MemberNotNull(_main_stream).Subscribe(_main_stream_onchange);
}
protected override void myOnLastSubscriber() { protected override void myOnFirstSubscriber() { _main_stream.onChange += _main_stream_onchange; }
subscription?.Dispose();
subscription = null; protected override void myOnLastSubscriber() { _main_stream.onChange -= _main_stream_onchange; }
}
private void _main_stream_onchange(object nv) { private void _main_stream_onchange(object nv) {
Log.notnull(_groupby_func); DataPacket dp = nv as DataPacket;
var dp = (IDataPacket)nv;
///grouping together ///grouping together
_timer.Restart(); _timer.Restart();
IDictionary<int, List<IBlueRow>> grouped_rows = (_groupby_cols == null || _groupby_cols.Length == 0) ? IDictionary<int, List<IBlueRow>> grouped_rows = (_groupby_cols == null || _groupby_cols.Length == 0) ?
@@ -121,10 +104,7 @@ namespace bts.BlueOrb {
// Log.log(bts.Log.Level.Info, bts.log.Subsystem.gen, String.Format("Time to group {0} rows into {1} groups = {2}", dp.newRows.Count, grouped_rows.Count, _timer.lastIntervalTime)); // Log.log(bts.Log.Level.Info, bts.log.Subsystem.gen, String.Format("Time to group {0} rows into {1} groups = {2}", dp.newRows.Count, grouped_rows.Count, _timer.lastIntervalTime));
/// reducing /// reducing
_timer.Restart(); _timer.Restart();
IBlueRowCollection? total_state = _groupby_func.evaluate(grouped_rows); IBlueRowCollection total_state = _groupby_func.evaluate(grouped_rows);
if (total_state == null)
// mayeb returna n empty table ?
return;
_timer.Stop(); _timer.Stop();
var applyElapsedMs = _timer.ElapsedMilliseconds; var applyElapsedMs = _timer.ElapsedMilliseconds;
_n_total_fires++; _n_total_fires++;
@@ -133,10 +113,9 @@ namespace bts.BlueOrb {
Log.DataFlow.info( Log.DataFlow.info(
$"Time to evaluate {grouped_rows.Count} groups {_timer.ElapsedMilliseconds}ms, ratio {_n_expensive_fires}/{_n_total_fires}"); $"Time to evaluate {grouped_rows.Count} groups {_timer.ElapsedMilliseconds}ms, ratio {_n_expensive_fires}/{_n_total_fires}");
} }
var deletedRows = myLastValue is null // TODO,
? new BlueTable(total_state.schema) if (total_state != null)
: ((IDataPacket)myLastValue).newRows; myFireEvent(new DataPacket(total_state, total_state, myLastValue == null ? new BlueTable(total_state.schema) : (myLastValue as DataPacket).newRows));
myFireEvent(new DataPacket(total_state, total_state, deletedRows));
} }
} }
} }
@@ -1,61 +1,59 @@
namespace bts.BlueOrb { namespace bts.BlueOrb {
using BCG; using BCG;
using RowHash = System.Int32;
using Bts.DataStream;
using Spark.Core.Diagnostics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using System.Text;
using RowHash = System.Int32; using System.Threading.Tasks;
using System.Collections;
using System.Data.Entity.Core.Mapping;
[DataStreamUserRespresentation("JoinStream")] [DataStreamUserRespresentation("JoinStream")]
public class SimpleJoinStream : ViewStream { public class SimpleJoinStream : ViewStream {
public class JoinBookkeepingData { public class JoinBookkeepingData {
// initialized in cons // initialized in cons
readonly string[] _join_col_names; private readonly List<string> _join_col_names;
private readonly bool _is_left;
private readonly BlueRowHasher _hasher; private readonly BlueRowHasher _hasher;
// initialized on first udpate // initialized on first udpate
IBlueTableSchema? _schema; private IBlueTableSchema _schema;
int[]? _join_cols; private int[] _join_cols;
private IDictionary<RowHash, List<IBlueRow>> _hash_row_map = new Dictionary<RowHash, List<IBlueRow>>(); private IDictionary<RowHash, List<IBlueRow>> _hash_row_map = new Dictionary<RowHash, List<IBlueRow>>();
public JoinBookkeepingData(ViewStream vs, List<string> join_cols, BlueRowHasher row_hasher) { public JoinBookkeepingData(ViewStream vs, List<string> join_cols, bool is_left, BlueRowHasher row_hasher) {
_join_col_names = join_cols.Where(c => !string.IsNullOrEmpty(c)).ToArray(); _join_col_names = join_cols.Where (c => !String.IsNullOrEmpty(c)).ToList ();
_is_left = is_left;
_hasher = row_hasher; _hasher = row_hasher;
} }
[NotNullIfNotNull(nameof(_schema))] public IBlueTableSchema schema => _schema;
public IBlueTableSchema? schema => _schema;
public IDictionary<RowHash, List<IBlueRow>> rows => _hash_row_map; public IDictionary<RowHash, List<IBlueRow>> rows => _hash_row_map;
[MemberNotNull(nameof(_schema))] public List<IBlueRow> get_matching_rows (int hash) {
public IBlueTableSchema RequireSchema() => List<IBlueRow> rv = null;
ExceptionAssert.MemberNotNull(_schema); _hash_row_map.TryGetValue(hash, out rv);
return rv;
public List<IBlueRow>? get_matching_rows(int hash) => }
_hash_row_map.GetValueOrDefault(hash);
private RowHash _get_hash(IBlueRow r) { private RowHash _get_hash(IBlueRow r) {
if (_join_cols == null || _join_cols.Length == 0) { if (_join_cols == null || _join_cols.Length == 0) {
return 0; return 0;
} }
return _hasher.get_hash(r, _join_cols); return _hasher.get_hash(r, _join_cols);
} }
public void update_data(IDataPacket dp) { public void update_data(DataPacket dp) {
if (!ready) { if (!ready) {
_schema = dp.newRows.schema; _schema = dp.newRows.schema;
_join_cols = _schema.ResolveIndices(_join_col_names); _join_cols = _join_col_names.Count == 0 ? new int[] { }: _join_col_names.Select(n => dp.schema[n].colNo).ToArray();
} }
_hash_row_map.Clear(); _hash_row_map.Clear();
foreach (IBlueRow r in dp.newRows) { foreach (IBlueRow r in dp.newRows) {
int hash = _get_hash(r); int hash = _get_hash(r);
if (!_hash_row_map.TryGetValue(hash, out var hash_rows)) { List<IBlueRow> hash_rows = null;
if (!_hash_row_map.TryGetValue(hash, out hash_rows)) {
hash_rows = new List<IBlueRow>(); hash_rows = new List<IBlueRow>();
_hash_row_map.Add(hash, hash_rows); _hash_row_map.Add(hash, hash_rows);
} }
@@ -63,7 +61,6 @@
} }
} }
[MemberNotNullWhen(true, nameof(_schema))]
public bool ready { public bool ready {
get { get {
return _schema != null; return _schema != null;
@@ -74,7 +71,8 @@
private ViewStream _ls, _rs; private ViewStream _ls, _rs;
private JoinBookkeepingData _ldata, _rdata; private JoinBookkeepingData _ldata, _rdata;
IBlueTableSchema? _schema; private ViewStreamDatabase _vsd;
private IBlueTableSchema _schema = null;
public SimpleJoinStream(ViewStream ls, string ljc, ViewStream rs, string rjc) : public SimpleJoinStream(ViewStream ls, string ljc, ViewStream rs, string rjc) :
this(ViewStreamDatabase.instance, ls, ljc, rs, rjc) { } this(ViewStreamDatabase.instance, ls, ljc, rs, rjc) { }
@@ -84,11 +82,11 @@
_rs = rs; _rs = rs;
List<string> lj_col_list = ljc.Split(',').Where(x => !String.IsNullOrEmpty(x)).ToList(); List<string> lj_col_list = ljc.Split(',').Where(x => !String.IsNullOrEmpty(x)).ToList();
List<string> rj_col_list = rjc.Split(',').Where(x => !String.IsNullOrEmpty(x)).ToList(); List<string> rj_col_list = rjc.Split(',').Where(x => !String.IsNullOrEmpty(x)).ToList();
Log.assert(lj_col_list.Count == rj_col_list.Count); Log.assert(lj_col_list.Count == rj_col_list.Count);
int n_cols = lj_col_list.Count; int n_cols = lj_col_list.Count;
BlueRowHasher hasher = new BlueRowHasher(n_cols); BlueRowHasher hasher = new BlueRowHasher(n_cols);
_ldata = new JoinBookkeepingData(ls, lj_col_list, hasher); _ldata = new JoinBookkeepingData(ls, lj_col_list, true, hasher);
_rdata = new JoinBookkeepingData(rs, rj_col_list, hasher); _rdata = new JoinBookkeepingData(rs, rj_col_list, false, hasher);
} }
protected override void myOnFirstSubscriber() { protected override void myOnFirstSubscriber() {
@@ -97,13 +95,13 @@
} }
private void _ls_onchange(object dp_obj) { private void _ls_onchange(object dp_obj) {
var dp = (IDataPacket)dp_obj; DataPacket dp = dp_obj as DataPacket;
_ldata.update_data(dp); _ldata.update_data(dp);
_form_and_fire(); _form_and_fire();
} }
private void _rs_onchange(object dp_obj) { private void _rs_onchange(object dp_obj) {
var dp = (IDataPacket)dp_obj; DataPacket dp = dp_obj as DataPacket ;
_rdata.update_data(dp); _rdata.update_data(dp);
_form_and_fire(); _form_and_fire();
} }
@@ -113,39 +111,58 @@
_rs.onChange -= _rs_onchange; _rs.onChange -= _rs_onchange;
} }
[MemberNotNull(nameof(_schema))]
private void _build_schema() { private void _build_schema() {
if (_schema != null) if (_schema != null)
return; return;
var lschema = Log.notnull(_ldata.schema); List<ColumnInfo> cis = new List<ColumnInfo>();
var rschema = Log.notnull(_rdata.schema); cis.Add(new ColumnInfo("id", 0, TypeCode.Int32));
var cis = new List<ColumnInfo> { foreach (ColumnInfo ci in _ldata.schema.columnInfo) {
new("id", 0, TypeCode.Int32) string col_name = _rdata.schema.contains_column(ci.colName) ? $"left_{ci.colName}" : ci.colName;
};
foreach (ColumnInfo ci in lschema.columnInfo) {
string col_name = rschema.contains_column(ci.colName) ? $"left_{ci.colName}" : ci.colName;
cis.Add(new ColumnInfo(col_name, cis.Count, ci.colType)); cis.Add(new ColumnInfo(col_name, cis.Count, ci.colType));
} }
foreach (ColumnInfo ci in rschema.columnInfo) { foreach (ColumnInfo ci in _rdata.schema.columnInfo) {
string col_name = lschema.contains_column(ci.colName) ? $"right_{ci.colName}" : ci.colName; string col_name = _ldata.schema.contains_column(ci.colName) ? $"right_{ci.colName}" : ci.colName;
cis.Add(new ColumnInfo(col_name, cis.Count, ci.colType)); cis.Add(new ColumnInfo(col_name, cis.Count, ci.colType));
} }
_schema = new BlueTableSchema($"{lschema.tableName}_join_{rschema.tableName}", cis.ToArray()); _schema = new BlueTableSchema($"{_ldata.schema.tableName}_join_{_rdata.schema.tableName}", cis.ToArray());
} }
private void _form_and_fire() { private void _form_and_fire() {
if (!_ldata.ready || !_rdata.ready) if (!_ldata.ready||!_rdata.ready)
return; return;
_build_schema(); _build_schema();
List<object[]> res_rows = new List<object[]>(); List<object[]> res_rows = new List<object[]>();
Action<object[], IBlueRow, bool> copy_row = (rval, r, is_left) => {
int offset = 1;
JoinBookkeepingData sdata = _ldata;
if (is_left) {
offset = 1;
sdata = _ldata;
} else {
sdata = _rdata;
offset = 1 + _ldata.schema.columnInfo.Length;
}
for (int i = 0; i < sdata.schema.columnInfo.Length; i++) {
rval[offset + i] = r[i];
}
};
Func<int, IBlueRow, object[]> build_row_array = (id, l_row) => {
object[] rv = new object[_schema.columnNames.Length];
for (int i = 0; i < _schema.columnNames.Length; i++) {
rv[i] = DBNull.Value;
}
rv[0] = id;
copy_row(rv, l_row, true);
return rv;
};
// this is where the join happens // this is where the join happens
foreach (var kv in _ldata.rows) { foreach (var kv in _ldata.rows) {
RowHash hash = kv.Key; RowHash hash = kv.Key;
List<IBlueRow> l_rows = kv.Value; List<IBlueRow> l_rows = kv.Value;
List<IBlueRow>? r_rows = _rdata.get_matching_rows(hash); List<IBlueRow> r_rows = _rdata.get_matching_rows(hash);
foreach (IBlueRow lr in l_rows) { foreach (IBlueRow lr in l_rows) {
if (r_rows != null) { if (r_rows != null) {
foreach (IBlueRow r in r_rows) { foreach (IBlueRow r in r_rows) {
object[] rowvals = build_row_array(res_rows.Count, lr); object[] rowvals = build_row_array(res_rows.Count, lr);
@@ -162,43 +179,9 @@
foreach (object[] rval in res_rows) { foreach (object[] rval in res_rows) {
rv.addRow(new BlueRow(_schema, rval)); rv.addRow(new BlueRow(_schema, rval));
} }
var dp = BlueDataUtility.build_dp(rv, myLastValue as IDataPacket); var dp = BlueDataUtility.build_dp(rv, myLastValue as DataPacket);
myFireEvent(dp); myFireEvent(dp);
object[] build_row_array(int id, IBlueRow l_row) {
object[] rv = new object[_schema.columnNames.Length];
for (int i = 0; i < _schema.columnNames.Length; i++) {
rv[i] = DBNull.Value;
}
rv[0] = id;
copy_row(rv, l_row, true);
return rv;
}
void copy_row(object?[] rval, IBlueRow r, bool is_left) {
int offset = 1;
JoinBookkeepingData sdata = _ldata;
if (is_left) {
offset = 1;
sdata = _ldata;
} else {
sdata = _rdata;
offset = 1 + _ldata.RequireSchema().columnInfo.Length;
}
for (int i = 0; i < sdata.RequireSchema().columnInfo.Length; i++) {
rval[offset + i] = r[i];
}
}
} }
}
[DataStreamUserRespresentation("FullJoinStream")]
public class FullJoinStream : ViewStream {
public FullJoinStream(ViewStream l_str, string ljcs, ViewStream r_str, string rjcs) {
ViewStream js = new SimpleJoinStream(l_str, ljcs, r_str, rjcs);
ViewStream rs = new bts.BlueOrb.FilterStream(js, r => !DBNull.Value.Equals(r["right_id"]));
mySetRealSource(rs);
}
} }
} }
@@ -45,8 +45,8 @@ namespace bts.BlueOrb {
} }
// aggregates multiple rows into one - ie does group_by compute // aggregates multiple rows into one - ie does group_by compute
public static IBlueRow? group_by_compute(List<IBlueRow> rows, MultiRowOpHelper parameters) { public static IBlueRow group_by_compute(List<IBlueRow> rows, MultiRowOpHelper parameters) {
if (rows.Count == 0) { if (rows.Count() == 0) {
return null; return null;
} }
@@ -73,8 +73,8 @@ namespace bts.BlueOrb {
} }
// aggregates multiple rows into one, used by MultiRowRollingMathStream // aggregates multiple rows into one, used by MultiRowRollingMathStream
public static IBlueRow? group_by_compute(List<IBlueRow> rows, int start_idx, int n_rows, MultiRowOpHelper parameters) { public static IBlueRow group_by_compute(List<IBlueRow> rows, int start_idx, int n_rows, MultiRowOpHelper parameters) {
if (rows.Count == 0) { if (rows.Count() == 0) {
return null; return null;
} }
IBlueRow ir = rows.ElementAt(start_idx); IBlueRow ir = rows.ElementAt(start_idx);
@@ -104,8 +104,8 @@ namespace bts.BlueOrb {
// rolling_rows are the rolling window of rows. the 0th row is the one thats gettin // rolling_rows are the rolling window of rows. the 0th row is the one thats gettin
// calculated. rows 1 - n-1 are its window rows. the schema is based on the operations. // calculated. rows 1 - n-1 are its window rows. the schema is based on the operations.
public IBlueRow? rolling_calc(List<IBlueRow> rolling_rows) { public IBlueRow rolling_calc(List<IBlueRow> rolling_rows) {
if (rolling_rows.Count == 0) { if (rolling_rows.Count() == 0) {
return null; return null;
} }
IBlueRow ir = rolling_rows.ElementAt(0); IBlueRow ir = rolling_rows.ElementAt(0);
@@ -150,13 +150,6 @@ namespace bts.BlueOrb {
return col_vals.Last(); return col_vals.Last();
case MultiRowOp.StdDev: case MultiRowOp.StdDev:
return MathNet.Numerics.Statistics.Statistics.StandardDeviation(col_vals); return MathNet.Numerics.Statistics.Statistics.StandardDeviation(col_vals);
case MultiRowOp.EdgeDiff:
return col_vals.First() - col_vals.Last();
case MultiRowOp.EdgeDiffPercentage: {
double first = col_vals.First();
double last = col_vals.Last();
return ((first - last) / last) * 100.0;
}
default: default:
// TODO // TODO
Log.assert(false); Log.assert(false);
@@ -1,7 +1,8 @@
namespace bts.BlueOrb { namespace bts.BlueOrb {
using BCG; using BCG;
using System; using System.Collections.Generic;
using System.Net;
[DataStreamUserRespresentation("MultiRowRollingMathStream")] [DataStreamUserRespresentation("MultiRowRollingMathStream")]
public class MultiRowRollingMathStream : ViewStream { public class MultiRowRollingMathStream : ViewStream {
@@ -23,12 +24,11 @@
} }
private void _parent_str_onchange(object dp_obj) { private void _parent_str_onchange(object dp_obj) {
var dp = (IDataPacket)dp_obj; DataPacket dp = dp_obj as DataPacket;
var rows = dp.newRows.to_list(); var rows = dp.newRows.to_list();
BlueTable? out_table = null; BlueTable out_table = null;
for (int i = 0; i < rows.Count; i++) { for (int i = 0; i < rows.Count; i++) {
var out_r = MultiRowOpHelper.group_by_compute(rows, i, _rolling_window_sz, _op) var out_r = MultiRowOpHelper.group_by_compute(rows, i, _rolling_window_sz, _op);
?? throw new InvalidOperationException("group_by_compute returned null row");
if (out_table == null) if (out_table == null)
out_table = new BlueTable(out_r.schema); out_table = new BlueTable(out_r.schema);
out_table.addRow(out_r); out_table.addRow(out_r);
@@ -1,8 +1,5 @@
namespace bts.BlueOrb { namespace bts.BlueOrb {
using BCG; using BCG;
using Spark.Core.Diagnostics;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@@ -57,7 +54,7 @@ namespace bts.BlueOrb {
public bool IsReadOnly { get { return true; } } public bool IsReadOnly { get { return true; } }
public object? this[object key] { public object this[object key] {
get { get {
if (key is string) if (key is string)
return this[(string)key]; return this[(string)key];
@@ -66,15 +63,16 @@ namespace bts.BlueOrb {
set { throw new NotSupportedException("The IBlueRow is readonly"); } set { throw new NotSupportedException("The IBlueRow is readonly"); }
} }
public object? this[int index] { public object this[int index] {
get { get {
return this[schema.columnInfo[index].colName]; return this[schema.columnInfo[index].colName];
} }
} }
public object? this[string col_name] { public object this[string col_name] {
get { get {
if (_project_data.mapped_to_orig_col_map.TryGetValue(col_name, out var mapped_to_col)) { string mapped_to_col = null;
if (_project_data.mapped_to_orig_col_map.TryGetValue(col_name, out mapped_to_col)) {
return _row[mapped_to_col]; return _row[mapped_to_col];
} }
return _row[col_name]; return _row[col_name];
@@ -91,8 +89,7 @@ namespace bts.BlueOrb {
} }
} }
public void Add(object key, object? value) => public void Add(object key, object value) { throw new NotSupportedException("The IBlueRow is readonly"); }
throw new NotSupportedException();
public void Clear() { throw new NotSupportedException("The IBlueRow is readonly"); } public void Clear() { throw new NotSupportedException("The IBlueRow is readonly"); }
@@ -117,7 +114,7 @@ namespace bts.BlueOrb {
private ViewStream _stream; private ViewStream _stream;
private string _project_expression; private string _project_expression;
ProjectData? _project_data; private ProjectData _project_data = null;
//public ProjectData //public ProjectData
public NewProjectStream(ViewStream vs, string project_expression) { public NewProjectStream(ViewStream vs, string project_expression) {
_stream = vs; _stream = vs;
@@ -131,8 +128,9 @@ namespace bts.BlueOrb {
return _project_data.out_schema; return _project_data.out_schema;
} }
public IBlueRow map(IBlueRow row) => public IBlueRow map(IBlueRow row) {
new NewProjectRow(ExceptionAssert.MemberNotNull(_project_data), row); return new NewProjectRow(_project_data, row);
}
// this is where most of the logic is, in terms of translating cols // this is where most of the logic is, in terms of translating cols
private static ProjectData _create_project_data(IBlueTableSchema input_schema, private static ProjectData _create_project_data(IBlueTableSchema input_schema,
@@ -37,8 +37,7 @@
// now this function should read _out_csv_filename into a dp // now this function should read _out_csv_filename into a dp
// and fire it // and fire it
_compute_and_write(); _compute_and_write();
//ViewStream rs = new SchemaGuesserStream(new CSVReaderStream(_out_csv_filename)); ViewStream rs = new SchemaGuesserStream(new CSVReaderStream(_out_csv_filename));
ViewStream rs = new CSVReaderStream(_out_csv_filename);
IBlueRowCollection nrows = null; IBlueRowCollection nrows = null;
rs.onChange += (dp_obj) => { rs.onChange += (dp_obj) => {
nrows = (dp_obj as DataPacket).newRows; nrows = (dp_obj as DataPacket).newRows;
@@ -1,25 +1,18 @@
using System; using System;
using System.Data.Entity.Core.Mapping;
using BCG; using BCG;
namespace bts.BlueOrb { namespace bts.BlueOrb {
// Keeps adding changing rows to the stream, hence preserving the history // Keeps adding changing rows to the stream, hence preserving the history
// and creating a time series, for example this can be used to make bbo updates // and creating a time series, for example this can be used to make bbo updates
// into a time series of prices/qty // into a time series of prices/qty
[DataStreamUserRespresentation("TimeSeriesStream")]
public class TimeSeriesStream : ViewStream { public class TimeSeriesStream : ViewStream {
private CircularBufferTable _table; private BlueTable _table;
private ViewStream _stream; private ViewStream _stream;
private int _id = 0; private int _id = 0;
private int _size = 0;
public TimeSeriesStream(ViewStream stream) public TimeSeriesStream(ViewStream stream) {
: this(stream, Int32.MaxValue) { }
public TimeSeriesStream(ViewStream stream, int size) {
_stream = stream; _stream = stream;
_size = size;
} }
protected override void myOnFirstSubscriber() { protected override void myOnFirstSubscriber() {
@@ -36,16 +29,17 @@ namespace bts.BlueOrb {
if (_table == null) { if (_table == null) {
IBlueTableSchema schema = new BlueTableSchema(dp.newRows.schema.columnInfo, dp.newRows.schema.tableName); IBlueTableSchema schema = new BlueTableSchema(dp.newRows.schema.columnInfo, dp.newRows.schema.tableName);
schema = schema.add_columns(Tuple.Create(typeof(DateTime), "timestamp")); schema = schema.add_columns(Tuple.Create(typeof(DateTime), "timestamp"));
_table = new CircularBufferTable(schema, _size); _table = new BlueTable(schema);
} }
BlueTable added_rows = new BlueTable(_table.schema);
foreach (IBlueRow r in dp.addedRows) { foreach (IBlueRow r in dp.addedRows) {
MutableBlueRow ar = new MutableBlueRow(_table.schema, r); MutableBlueRow ar = new MutableBlueRow(_table.schema, r);
ar.setValue("timestamp", now); ar.setValue("timestamp", now);
ar.setValue("id", _id++); ar.setValue("id", _id++);
_table.add_row(ar); added_rows.addRow(ar);
} }
var dp_out = BlueDataUtility.build_dp(_table, myLastValue as DataPacket); _table.addRows(added_rows);
myFireEvent(dp_out); myFireEvent(new DataPacket(_table, added_rows, new BlueTable(_table.schema)));
} }
} }
@@ -5,8 +5,7 @@ namespace bts.BlueOrb {
using mbts; using mbts;
using BCG; using BCG;
// [DataStreamUserRespresentation("UnionStream")] [DataStreamUserRespresentation("UnionStream")]
[DataStreamUserRespresentation("AppendStream")]
public class UnionStream : ViewStream { public class UnionStream : ViewStream {
public UnionStream(ViewStream left_stream, ViewStream right_stream) { public UnionStream(ViewStream left_stream, ViewStream right_stream) {
ViewStream rs = new BCG.MutableAppendStream(left_stream, right_stream); ViewStream rs = new BCG.MutableAppendStream(left_stream, right_stream);
@@ -5,6 +5,17 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ArithmeticExpressions\ArithmeticExpressions.csproj" />
<ProjectReference Include="..\BaseUtilities\BaseUtilities.csproj" />
<ProjectReference Include="..\BooleanExpressions\BooleanExpressions.csproj" />
<ProjectReference Include="..\Bts.ColumnExpressions\Bts.ColumnExpressions.csproj" />
<ProjectReference Include="..\Bts.ColumnSortExpressions\Bts.ColumnSortExpressions.csproj" />
<ProjectReference Include="..\DataStreamCore\DataStreamCore.csproj" />
<ProjectReference Include="..\DataStreamExpressions\DataStreamExpressions.csproj" />
<ProjectReference Include="..\..\client\spark_core\spark_core.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.57" /> <PackageReference Include="HtmlAgilityPack" Version="1.11.57" />
<PackageReference Include="IronPython" Version="3.4.2" /> <PackageReference Include="IronPython" Version="3.4.2" />
@@ -16,27 +27,4 @@
<PackageReference Include="MathNet.Numerics" Version="5.0.0" /> <PackageReference Include="MathNet.Numerics" Version="5.0.0" />
</ItemGroup> </ItemGroup>
<Choose>
<When Condition="'$(UseProjectRefs)' == 'true'">
<ItemGroup>
<ProjectReference Include="..\ArithmeticExpressions\ArithmeticExpressions.csproj" />
<ProjectReference Include="..\BaseUtilities\BaseUtilities.csproj" />
<ProjectReference Include="..\BooleanExpressions\BooleanExpressions.csproj" />
<ProjectReference Include="..\Bts.ColumnExpressions\Bts.ColumnExpressions.csproj" />
<ProjectReference Include="..\Bts.ColumnSortExpressions\Bts.ColumnSortExpressions.csproj" />
<ProjectReference Include="..\DataStreamExpressions\DataStreamExpressions.csproj" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="ArithmeticExpressions" Version="$(SparkVersion)" />
<PackageReference Include="BaseUtilities" Version="$(SparkVersion)" />
<PackageReference Include="BooleanExpressions" Version="$(SparkVersion)" />
<PackageReference Include="Bts.ColumnExpressions" Version="$(SparkVersion)" />
<PackageReference Include="Bts.ColumnSortExpressions" Version="$(SparkVersion)" />
<PackageReference Include="DataStreamExpressions" Version="$(SparkVersion)" />
</ItemGroup>
</Otherwise>
</Choose>
</Project> </Project>
@@ -5,46 +5,46 @@ using BCG;
using bts.api.core; using bts.api.core;
using Bts.DataStreamCore; using Bts.DataStreamCore;
using Bts.PubSub;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Spark.Core.Disposables; using Spark.Core.Disposables;
using Spark.Core.Threading;
using System; using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reactive.Linq; using System.Reactive.Linq;
public static class DataStreamExtensions { public static class DataStreamExtensions {
public static ViewStream AsViewStream(this IObservable<IDataPacket> source) => public static ViewStream AsViewStream(this IObservable<DataPacket> source) =>
source as ViewStream ?? new ObservableViewStream(source); source as ViewStream ?? new ObservableViewStream(source);
public static ViewStream AsViewStream<T>(this IObservable<IDataPacket<T>> source, string? name = null, ILogger? logger = null) where T : IBlueRow => public static ViewStream AsViewStream<T>(this IObservable<IDataPacket<T>> source, string? name = null, ILogger? logger = null) where T : IBlueRow =>
source as ViewStream ?? new ObservableViewStream(source.Select(dp => new DataPacket(dp.newRows, dp.addedRows, dp.deletedRows)), name, logger); source as ViewStream ?? new ObservableViewStream(source.Select(dp => new DataPacket(dp.newRows, dp.addedRows, dp.deletedRows)), name, logger);
public static IObservable<IDataPacket> AsObservable(this ViewStream source) { public static IObservable<DataPacket> AsObservable(this ViewStream source) {
return source as IObservable<IDataPacket> ?? Observable.Create<IDataPacket>(Subscribe); return source as IObservable<DataPacket> ?? Observable.Create<DataPacket>(Subscribe);
IDisposable Subscribe(IObserver<IDataPacket> observer) { IDisposable Subscribe(IObserver<DataPacket> observer) {
source.onChange += OnChange; source.onChange += OnChange;
return Disposable.Create(() => source.onChange -= OnChange); return Disposable.Create(() => source.onChange -= OnChange);
void OnChange(object? newValue) => void OnChange(object? newValue) =>
observer.OnNext(newValue as IDataPacket ?? throw new ArgumentException( observer.OnNext(newValue as DataPacket ?? throw new ArgumentException(
$"Expected IDataPacket, got {newValue?.GetType()}", nameof(newValue))); $"Expected DataPacket, got {newValue?.GetType()}", nameof(newValue)));
} }
} }
// public static IObservable<IDataPacket<T>> SelectDataPacket<T>(this IObservable<IDataPacket> source, Func<IBlueRow, T> selector) where T : IBlueRow => public static IObservable<IDataPacket<T>> SelectDataPacket<T>(this IObservable<IDataPacket> source, Func<IBlueRow, T> selector) where T : IBlueRow =>
// source.Select(dp => { source.Select(dp => {
// dp.get_new_added_deleted(out var newRows, out var addedRows, out var deletedRows); dp.get_new_added_deleted(out var newRows, out var addedRows, out var deletedRows);
// return new DataPacket<T>(CastRows(newRows), CastRows(addedRows), CastRows(deletedRows)); return new DataPacket<T>(CastRows(newRows), CastRows(addedRows), CastRows(deletedRows));
// IBlueRowCollection<T> CastRows(ICollection rows) => IBlueRowCollection<T> CastRows(ICollection rows) =>
// new BlueTableSelectorWrapper<T>( new BlueTableSelectorWrapper<T>(
// rows as IBlueRowCollection ?? new BlueRowCollection(rows, dp.Schema), selector); rows as IBlueRowCollection ?? new BlueRowCollection(rows, dp.Schema), selector);
// }); });
public static IObservable<TableUpdate<IBlueRow, int>> AsTables(this IObservable<IDataPacket> source) => public static IObservable<TableUpdate<IBlueRow, int>> AsTables(this IObservable<IDataPacket> source) =>
source.AsTables<IBlueRow, int>(r => r, r => r.Id()); source.AsTables<IBlueRow, int>(r => r, r => r.Id());
@@ -59,78 +59,36 @@ public static class DataStreamExtensions {
public static IObservable<TableUpdate<T, TKey>> AsTables<T, TKey>( public static IObservable<TableUpdate<T, TKey>> AsTables<T, TKey>(
this IObservable<IDataPacket> source, Func<IBlueRow, T> valueSelector, Func<T, TKey> keySelector, Func<IBlueRow, TKey>? rowKeySelector = null) where TKey : IEquatable<TKey> { this IObservable<IDataPacket> source, Func<IBlueRow, T> valueSelector, Func<T, TKey> keySelector, Func<IBlueRow, TKey>? rowKeySelector = null) where TKey : IEquatable<TKey> {
rowKeySelector ??= r => keySelector(valueSelector(r)); rowKeySelector ??= r => keySelector(valueSelector(r));
return source.Scan(TableUpdate<T, TKey>.Empty(keySelector), (res, dp) => { return source.Scan(TableUpdate<T, TKey>.mk_empty(keySelector), (res, dp) => {
var bd = res.ToBuilder(); var bd = res.to_builder();
dp.get_new_added_deleted(out var newRows, out var addedRows, out var deletedRows); dp.get_new_added_deleted(out var newRows, out var addedRows, out var deletedRows);
foreach (IBlueRow r in addedRows) { foreach (IBlueRow r in addedRows) {
bd.AddOrUpdate(valueSelector(r)); bd.add_or_update(valueSelector(r));
} }
foreach (IBlueRow r in deletedRows) { foreach (IBlueRow r in deletedRows) {
bd.Remove(rowKeySelector(r)); bd.remove(rowKeySelector(r));
} }
return bd.ToImmutable(); return bd.to_table();
}); });
} }
public static IObservable<IDataPacket> AsDataPackets(this IObservable<TableUpdate<IBlueRow, int>> source) => public static IObservable<IDataPacket<T>> AsDataPackets<T>(this IObservable<TableUpdate<T, int>> source, IBlueTableSchema schema) where T : IBlueRow =>
source.Scan( source.Scan(
(Table: (BlueTableImmutable?)null, Dp: (IDataPacket?)null), (Table: new BlueTableImmutable<T>(schema), Dp: (IDataPacket<T>)DataPacket<T>.Empty(schema)),
(res, table) => {
var resTable = res.Table;
if (resTable is null) {
if (table.Index.Count == 0) {
return (null, null);
}
resTable = new(table.Index.Values.First().schema);
}
var bd = resTable.ToDataPacketBuilder();
foreach (var r in table.RemovedItems) {
bd.Remove(r.Id());
}
foreach (var r in table.AddedItems) {
bd.AddOrUpdate(r);
}
var resDp = bd.ToDataPacket(out var newRows);
return (newRows, resDp);
})
.Where(t => t.Dp is not null && (t.Dp.addedRows.Count > 0 || t.Dp.deletedRows.Count > 0))
.Select(t => t.Dp!);
public static IObservable<IDataPacket> AsDataPackets<T>(this IObservable<TableUpdate<T, int>> source, IBlueTableSchema schema) where T : IBlueRow =>
source.Scan(
(Table: new BlueTableImmutable(schema), Dp: (IDataPacket)new DataPacket(schema)),
(res, table) => { (res, table) => {
var bd = res.Table.ToDataPacketBuilder(); var bd = res.Table.ToDataPacketBuilder();
foreach (var r in table.RemovedItems) { foreach (var r in table.removed) {
bd.Remove(r.Id()); bd.Remove(r.Id());
} }
foreach (var r in table.AddedItems) { foreach (var r in table.added) {
bd.AddOrUpdate(r); bd.AddOrUpdate(r);
} }
var resDp = bd.ToDataPacket(out var newRows); var resDp = bd.ToDataPacketT(out var newRows, out var addedRows, out var deletedRows);
return (newRows, resDp); return (newRows, resDp);
}) })
.Where(t => t.Dp.addedRows.Count > 0 || t.Dp.deletedRows.Count > 0) .Where(t => t.Dp.addedRows.Any() || t.Dp.deletedRows.Any())
.Select(t => t.Dp); .Select(t => t.Dp);
public static IObservable<IDataPacket> AsDataPackets<T, TKey>(this IObservable<TableUpdate<T, TKey>> source, BlueTableSchemaAdapter<T> schema) where TKey : IEquatable<TKey> {
return Observable.Create<IDataPacket>(Subscribe);
IDisposable Subscribe(IObserver<IDataPacket> o) {
var adapter = new BlueTableImmutableAdapter<T>(schema);
IDataPacket initDataPacket = new DataPacket(schema);
return source.Scan((Adapter: adapter, DataPacket: initDataPacket), OnUpdate).Select(res => res.DataPacket).Subscribe(o);
(BlueTableImmutableAdapter<T> Adapter, IDataPacket DataPacket) OnUpdate(
(BlueTableImmutableAdapter<T> Adapter, IDataPacket DataPacket) state, TableUpdate<T, TKey> tableUpdate) {
var bd = state.Adapter.ToDataPacketBuilder();
bd.Update(tableUpdate);
var newRows = bd.ToImmutable(out var dp);
return (newRows, dp);
}
}
}
public static ViewStream AsViewStream<T>(this IObservable<TableUpdate<T, int>> source, IBlueTableSchema schema) where T : IBlueRow => public static ViewStream AsViewStream<T>(this IObservable<TableUpdate<T, int>> source, IBlueTableSchema schema) where T : IBlueRow =>
source.AsDataPackets(schema).AsViewStream(); source.AsDataPackets(schema).AsViewStream();
@@ -173,46 +131,4 @@ public static class DataStreamExtensions {
} }
return indices; return indices;
} }
public static IObservable<IDataPacket> OnWorkScheduler(this IObservable<IDataPacket> source, IWorkScheduler scheduler) =>
Observable.Create<IDataPacket>(o => {
var inputGate = new AtomicGate();
var outputGate = new AtomicGate();
BlueTableImmutable? lastTable = null;
BlueTableImmutable.DataPacketBuilder? bd = null;
IDataPacket? pendingDpOut = null;
return Disposable.Create(source.Subscribe(OnNext), scheduler.Subscribe(DoWork));
void OnNext(IDataPacket value) {
using (inputGate.BeginTransaction()) {
lastTable ??= new(value.newRows.schema);
bd ??= lastTable.ToDataPacketBuilder();
if (pendingDpOut is null) {
// The last outgoing datapacket was just fired. Don't merge this update with the
// previous one (otherwise its adds/removes would be fired twice).
bd.Reset();
}
foreach (IBlueRow r in value.deletedRows) {
bd.Remove(r.Id());
}
foreach (IBlueRow r in value.addedRows) {
bd.AddOrUpdate(r);
}
pendingDpOut = bd.ToDataPacket(out lastTable);
}
}
void DoWork() {
IDataPacket? dpOut = null;
if (outputGate.TryEnter()) {
using var exit = Disposable.Create(outputGate.Exit);
(dpOut, pendingDpOut) = (pendingDpOut, dpOut);
if (dpOut is not null) {
o.OnNext(dpOut);
}
}
}
});
} }
@@ -1,9 +1,8 @@
namespace bts.BlueOrb { namespace bts.SilverPine {
using System; using System;
using BCG; using BCG;
using System.Collections.Generic; using System.Collections.Generic;
using Bts.DataStreamExpressions; using Bts.DataStreamExpressions;
using System.Xml;
// All this does is take in a dsl expression, parse it and fire the data that come out of running it. // All this does is take in a dsl expression, parse it and fire the data that come out of running it.
// So for example, if an expresison is passed // So for example, if an expresison is passed
@@ -12,10 +11,9 @@ namespace bts.BlueOrb {
private readonly string _dsl; private readonly string _dsl;
public DSLStream(string dsl) { public DSLStream(string dsl) {
Log.Gen.info($"DSLStream.cons dsl: {dsl}"); Log.Gen.info($"DSLStream.cons dsl: {dsl}");
// Remove all colons
string sanitizedDsl = dsl.Replace(":", "COLON");
_dsl = dsl; _dsl = dsl;
ViewStream rs = build_stream(dsl) ?? new LiteralStream("error", $"msg:invalid dsl"); ViewStream rs = build_stream(dsl);
rs = rs ?? new LiteralStream("error", $"msg:invalid dsl \"{dsl}\"");
mySetRealSource(rs); mySetRealSource(rs);
} }
@@ -26,10 +24,9 @@ namespace bts.BlueOrb {
return rv; return rv;
} catch (Exception ex) { } catch (Exception ex) {
//send to blueorb
Log.Gen.error($"Could not build stream: {stream_expression} ex: {ex}"); Log.Gen.error($"Could not build stream: {stream_expression} ex: {ex}");
return null; return null;
} }
} }
} }
} }
@@ -1,13 +1,14 @@
namespace Bts.DataStream; namespace Bts.DataStream;
using BCG; using BCG;
using BCG.Extensions;
using BCG.Utilities.General; using BCG.Utilities.General;
using bts; using bts;
using bts.collections;
using Bts.DataStreamCore; using Bts.DataStreamCore;
using Spark.Core.Collections;
using Spark.Core.Disposables; using Spark.Core.Disposables;
using System; using System;
@@ -8,13 +8,13 @@ using Microsoft.Extensions.Logging;
using System; using System;
public class ObservableViewStream : ViewStream, IObservable<IDataPacket>, IDisposable { public class ObservableViewStream : ViewStream, IObservable<DataPacket>, IDisposable {
readonly IObservable<IDataPacket> source; readonly IObservable<DataPacket> source;
readonly string? name; readonly string? name;
readonly ILogger? logger; readonly ILogger? logger;
IDisposable? subscription; IDisposable? subscription;
public ObservableViewStream(IObservable<IDataPacket> source, string? name = null, ILogger? logger = null) { public ObservableViewStream(IObservable<DataPacket> source, string? name = null, ILogger? logger = null) {
this.source = source; this.source = source;
this.name = name; this.name = name;
this.logger = logger; this.logger = logger;
@@ -45,6 +45,6 @@ public class ObservableViewStream : ViewStream, IObservable<IDataPacket>, IDispo
subscription = null; subscription = null;
} }
IDisposable IObservable<IDataPacket>.Subscribe(IObserver<IDataPacket> observer) => IDisposable IObservable<DataPacket>.Subscribe(IObserver<DataPacket> observer) =>
source.Subscribe(observer); source.Subscribe(observer);
} }
@@ -1,25 +1,14 @@
using bts;
using Bts.DataStream;
using Bts.DataStreamCore;
using Bts.DataStreamExpressions;
using Bts.PubSub;
using Microsoft.Extensions.Hosting;
using Spark.Core.Disposables;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Reactive.Linq; using Bts.DataStreamExpressions;
using System.Threading; using BCG.Utilities.General;
using System.Threading.Tasks; using bts;
namespace BCG { namespace BCG {
// listens to the requests posted on "cloud_streams" request table, and // listens to the requests posted on "cloud_streams" request table, and
// if unfulfilled starts a ViewPubsliher // if unfulfilled starts a ViewPubsliher
public class RemoteQueryManager : IHostedService { public class RemoteQueryManager : IWorker {
public class StreamPubUnit { public class StreamPubUnit {
public string name; public string name;
public string stream_expression; public string stream_expression;
@@ -50,45 +39,23 @@ namespace BCG {
} }
private IDictionary<string, StreamPubUnit> private IDictionary<string, StreamPubUnit>
_stream_pub_map = new Dictionary<string, StreamPubUnit>(); _stream_pub_map = new Dictionary<string, StreamPubUnit>();
readonly IPubTableBroker _broker; private ViewStream _stream = new TableStream("cloud_streams");
readonly IManagedSubscriber _sub; private PubTableBroker _broker = new PubTableBroker();
readonly object syncRoot = new(); private ManagedSubscriber _sub = ManagedSubscriber.instance;
IDisposable? cloudStreamsSub;
IDisposable? remoteRequestsSub;
bool isDisposed;
public RemoteQueryManager(IManagedSubscriber managedSubscriber, IPubTableBroker pubTableBroker) { public RemoteQueryManager() {
_sub = managedSubscriber; _stream.onChange += _on_str;
_broker = pubTableBroker; _sub.subscribe("RemoteRequest", (string tag, byte[] data) => {
RemoteRequest req = RemoteRequest.construct_from_bytes(data);
_spawn_remote_stream(req.published_table_name, req.stream_expression, false);
});
} }
private void _on_str(object obj)
public Task StartAsync(CancellationToken cancellationToken) { {
lock (syncRoot) { if (obj is not DataPacket dp) {
Log.assert(!isDisposed); return;
Log.isnull(cloudStreamsSub);
Log.isnull(remoteRequestsSub);
cloudStreamsSub = new TableStream("cloud_streams").AsObservable().Subscribe(_on_str);
remoteRequestsSub = _sub.Observe("RemoteRequest").Subscribe(data => {
RemoteRequest req = RemoteRequest.construct_from_bytes(data);
_spawn_remote_stream(req.published_table_name, req.stream_expression, false);
});
} }
return Task.CompletedTask;
}
public Task StopAsync(CancellationToken cancellationToken) {
lock (syncRoot) {
if (!isDisposed) {
isDisposed = true;
Disposable.dispose(ref cloudStreamsSub);
Disposable.dispose(ref remoteRequestsSub);
}
}
return Task.CompletedTask;
}
void _on_str(IDataPacket dp) {
foreach (IBlueRow r in dp.newRows) foreach (IBlueRow r in dp.newRows)
{ {
string name = r.get<string>("name"); string name = r.get<string>("name");
@@ -105,10 +72,7 @@ namespace BCG {
ViewStream stream = build_stream(stream_expression); ViewStream stream = build_stream(stream_expression);
_expose_to_ws(name, stream); _expose_to_ws(name, stream);
if (persist) { if (persist) {
string tempDir = Path.GetTempPath(); stream = new PersistorStream(stream, name, "C:\\Temp\\", 1000000); // 10MBs
Directory.CreateDirectory(tempDir); // make sure it exists
stream = new PersistorStream(stream, name, tempDir, 10_000_000); // 10 MB
} }
ViewPublisher view_pub = new ViewPublisher(name, _broker, stream); ViewPublisher view_pub = new ViewPublisher(name, _broker, stream);
StreamPubUnit u = new StreamPubUnit(name, stream_expression, stream, persist, view_pub); StreamPubUnit u = new StreamPubUnit(name, stream_expression, stream, persist, view_pub);
@@ -118,5 +82,9 @@ namespace BCG {
private void _expose_to_ws(string name, ViewStream stream) { private void _expose_to_ws(string name, ViewStream stream) {
// TODO: john // TODO: john
} }
public void doWork() {
}
} }
} }
@@ -9,7 +9,7 @@ namespace BCG {
[DataStreamUserRespresentation("remoteQuery")] [DataStreamUserRespresentation("remoteQuery")]
public class RemoteQueryStream : ViewStream { public class RemoteQueryStream : ViewStream {
private readonly string _name, _stream_exp; private readonly string _name, _stream_exp;
private PublisherCore _publisher_core = PublisherCore.Create(); private PublisherCore _publisher_core = new PublisherCore();
private ViewStream _source_str; private ViewStream _source_str;
public RemoteQueryStream(params string[] lines) { public RemoteQueryStream(params string[] lines) {
@@ -2,6 +2,9 @@ namespace bts {
using System.IO; using System.IO;
using BCG; using BCG;
using System.IO;
using System.Threading.Tasks.Dataflow;
public class RemoteRequest { public class RemoteRequest {
public readonly string stream_expression; public readonly string stream_expression;
public readonly string published_table_name; public readonly string published_table_name;
@@ -25,4 +28,4 @@ namespace bts {
} }
} }
} }
@@ -1,28 +1,33 @@
using Spark.Core.Collections;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace BCG { namespace BCG {
public class AddColumnsStream : ViewStream { public class AddColumnsStream : ViewStream {
public static (string Name, Type Type, object Value) parse_single_tok(string exp) { public static Tuple<string, Type, object> parse_single_tok(string exp) {
string[] toks = exp.Split(':'); string[] toks = exp.Split(':');
string col_name = toks[0].Trim(); string col_name = toks[0].Trim();
string col_value = toks[1].Trim(); string col_value = toks[1].Trim();
Tuple<Type, object> tup = BlueDataUtility.guess_type(col_value); Tuple<Type, object> tup = BlueDataUtility.guess_type(col_value);
return (col_name, tup.Item1, tup.Item2); return Tuple.Create(col_name, tup.Item1, tup.Item2);
} }
public static List<(string Name, Type Type, object Value)> parse_exp(string exp) => public static List<Tuple<string, Type, object>> parse_exp(string exp) {
exp.Split(",").ToList(t => parse_single_tok(t.Trim())); string[] toks = exp.Split(",");
List<Tuple<string, Type, object>> rv = new List<Tuple<string, Type, object>>();
foreach (string s in toks) {
var tup = parse_single_tok(s.Trim());
rv.Add(tup);
}
return rv;
}
readonly List<(string Name, Type Type, object Value)> _new_col_map; private Tuple<string, Type, object> _new_col;
IBlueTableSchema? _out_schema; private List<Tuple<string, Type, object>> _new_col_map;
private IBlueTableSchema _out_schema;
public AddColumnsStream(ViewStream vs, string col_def) { public AddColumnsStream(ViewStream vs, string col_def) {
_new_col_map = parse_exp(col_def); _new_col_map = parse_exp(col_def);
ViewStream rs = new MapStream(vs, _get_schema, _map); ViewStream rs = new MapStream(vs, (IBlueTableSchema s) => _get_schema(s), (IBlueRow r) => _map(r));
mySetRealSource(rs); mySetRealSource(rs);
} }
@@ -39,7 +44,7 @@ namespace BCG {
private IBlueRow _map(IBlueRow r) { private IBlueRow _map(IBlueRow r) {
MutableBlueRow rv = new MutableBlueRow(_get_schema(r.schema), r); MutableBlueRow rv = new MutableBlueRow(_get_schema(r.schema), r);
foreach (var m in _new_col_map) { foreach (var m in _new_col_map) {
rv.setValue(m.Name, m.Value); rv.setValue(m.Item1, m.Item3);
} }
return rv; return rv;
} }
@@ -1,10 +1,9 @@
using mbts; using System;
using Spark.Core.Diagnostics;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using mbts;
namespace BCG namespace BCG
{ {
@@ -34,7 +33,7 @@ namespace BCG
private void _stream_onChange(object newValue) private void _stream_onChange(object newValue)
{ {
var dp = (IDataPacket)newValue; DataPacket dp = newValue as DataPacket;
if (dp != null && dp.newRows.Count > 0) if (dp != null && dp.newRows.Count > 0)
{ {
_stream.onChange -= _stream_onChange; _stream.onChange -= _stream_onChange;
@@ -43,8 +42,8 @@ namespace BCG
} }
} }
public delegate void IncrementValues(object?[] current_values, object?[] values_to_inc); public delegate void IncrementValues(object[] current_values, object[] values_to_inc);
public delegate string GetColumnPrefix(object?[] transposing_col_values); public delegate string GetColumnPrefix(object[] transposing_col_values);
public delegate string GetColumnSuffix(string col_name); public delegate string GetColumnSuffix(string col_name);
private GetColumnSuffix _get_column_suffix = new GetColumnSuffix((cn) => { return cn; }); private GetColumnSuffix _get_column_suffix = new GetColumnSuffix((cn) => { return cn; });
@@ -52,31 +51,33 @@ namespace BCG
private IncrementValues _increment_values; private IncrementValues _increment_values;
private GetColumnPrefix _get_column_prefix; private GetColumnPrefix _get_column_prefix;
IBlueTableSchema? _schema; private IBlueTableSchema _schema;
private string[] _group_by_cols; private string[] _group_by_cols;
private Pair<string, Type>[] _cols_per_transposed; private Pair<string, Type>[] _cols_per_transposed;
private string[] _transposing_cols; private string[] _transposing_cols;
int[]? _transposing_col_indices; private int[] _transposing_col_indices;
Comparison<Pair<int, object?[]>>? _transpsed_col_value_comparer_wrapper; private Comparison<Pair<int, object[]>> _transpsed_col_value_comparer_wrapper;
public YXTranspositionStream(ViewStream stream, string transposed_cols_group, string cols_per_transposed, string group_by_cols, public YXTranspositionStream(ViewStream stream, string transposed_cols_group, string cols_per_transposed, string group_by_cols,
IncrementValues increment_values_del, GetColumnPrefix get_column_prefix_del, GetColumnSuffix get_column_suffix_del, Comparison<object?[]> transposed_col_value_comparer) IncrementValues increment_values_del, GetColumnPrefix get_column_prefix_del, GetColumnSuffix get_column_suffix_del, Comparison<object[]> transposed_col_value_comparer)
: this(stream, transposed_cols_group, cols_per_transposed, group_by_cols, increment_values_del, : this(stream, transposed_cols_group, cols_per_transposed, group_by_cols, increment_values_del,
get_column_prefix_del, get_column_suffix_del, transposed_col_value_comparer, true) get_column_prefix_del, get_column_suffix_del, transposed_col_value_comparer, true)
{ } { }
public YXTranspositionStream(ViewStream stream, string transposed_cols_group, string cols_per_transposed, string group_by_cols, public YXTranspositionStream(ViewStream stream, string transposed_cols_group, string cols_per_transposed, string group_by_cols,
IncrementValues increment_values_del, GetColumnPrefix get_column_prefix_del, GetColumnSuffix get_column_suffix_del, Comparison<object?[]> transposed_col_value_comparer, bool only_fire_once) IncrementValues increment_values_del, GetColumnPrefix get_column_prefix_del, GetColumnSuffix get_column_suffix_del, Comparison<object[]> transposed_col_value_comparer, bool only_fire_once)
{ {
if (get_column_suffix_del != null) if (get_column_suffix_del != null)
_get_column_suffix = get_column_suffix_del; _get_column_suffix = get_column_suffix_del;
if (transposed_col_value_comparer != null) if (transposed_col_value_comparer != null)
{ {
_transpsed_col_value_comparer_wrapper = new((p1, p2) => _transpsed_col_value_comparer_wrapper = new Comparison<Pair<int, object[]>>((p1,p2) =>
transposed_col_value_comparer(ExceptionAssert.NotNull(p1.second), ExceptionAssert.NotNull(p2.second))); {
return transposed_col_value_comparer(p1.second, p2.second);
});
} }
_group_by_cols = group_by_cols.Split(' '); _group_by_cols = group_by_cols.Split(' ');
_transposing_cols = transposed_cols_group.Split(' '); _transposing_cols = transposed_cols_group.Split(' ');
@@ -105,7 +106,7 @@ namespace BCG
col_info.Add(new ColumnInfo(p.first, col_index++, p.second)); col_info.Add(new ColumnInfo(p.first, col_index++, p.second));
foreach (string tc_prefix in tc_prefixes) foreach (string tc_prefix in tc_prefixes)
foreach (Pair<string, Type> p in _cols_per_transposed) foreach (Pair<string, Type> p in _cols_per_transposed)
col_info.Add(new ColumnInfo(_get_full_column_name(tc_prefix, p.first ?? string.Empty), col_index++, p.second)); col_info.Add(new ColumnInfo(_get_full_column_name(tc_prefix, p.first), col_index++, p.second));
IBlueTableSchema schema = new BlueTableSchema(col_info.ToArray(), "xy_transposed_" + table_name); IBlueTableSchema schema = new BlueTableSchema(col_info.ToArray(), "xy_transposed_" + table_name);
if (_schema == null) if (_schema == null)
_schema = schema; _schema = schema;
@@ -129,14 +130,19 @@ namespace BCG
public IBlueRowCollection evaluate(IDictionary<int, List<IBlueRow>> grouped_rows) public IBlueRowCollection evaluate(IDictionary<int, List<IBlueRow>> grouped_rows)
{ {
var all_tc_infos_and_values = new Dictionary<int, Dictionary<int, object?[]>>(); Dictionary<int, Dictionary<int, object[]>> all_tc_infos_and_values = new Dictionary<int, Dictionary<int, object[]>>();
var group_by_cols_value_dict = new Dictionary<int, object?[]>(); Dictionary<int, object[]> group_by_cols_value_dict = new Dictionary<int, object[]>();
BlueRowHasher hasher = new BlueRowHasher(_transposing_cols.Length); BlueRowHasher hasher = new BlueRowHasher(_transposing_cols.Length);
Pair<string, Type>[] group_by_col_info = new Pair<string, Type>[_group_by_cols.Length]; Pair<string, Type>[] group_by_col_info = new Pair<string, Type>[_group_by_cols.Length];
string table_name = string.Empty; string table_name = string.Empty;
if (grouped_rows.Count > 0) if (grouped_rows.Count > 0)
{ {
var schema = grouped_rows.Values.First()[0].schema; IBlueTableSchema schema = null;
foreach (KeyValuePair<int, List<IBlueRow>> kvp in grouped_rows)
{
schema = kvp.Value[0].schema;
break;
}
table_name = schema.tableName; table_name = schema.tableName;
_transposing_col_indices = BlueDataUtility.get_column_indices(schema, _transposing_cols); _transposing_col_indices = BlueDataUtility.get_column_indices(schema, _transposing_cols);
int[] group_by_indices = BlueDataUtility.get_column_indices(schema, _group_by_cols); int[] group_by_indices = BlueDataUtility.get_column_indices(schema, _group_by_cols);
@@ -149,22 +155,23 @@ namespace BCG
else else
return new BlueTable(new BlueTableSchema(new ColumnInfo[] { new ColumnInfo("id", 0, typeof(int)) }, table_name)); return new BlueTable(new BlueTableSchema(new ColumnInfo[] { new ColumnInfo("id", 0, typeof(int)) }, table_name));
Dictionary<int, string> tc_prefixes = new Dictionary<int, string>(); Dictionary<int, string> tc_prefixes = new Dictionary<int, string>();
var tc_values = new List<Pair<int, object?[]>>(); List<Pair<int, object[]>> tc_values = new List<Pair<int, object[]>>();
foreach (KeyValuePair<int, List<IBlueRow>> kvp in grouped_rows) foreach (KeyValuePair<int, List<IBlueRow>> kvp in grouped_rows)
{ {
//Dictionary of trans_col_group_hash -> pair: first=trans_col_group_values second=per_transposing_col_values //Dictionary of trans_col_group_hash -> pair: first=trans_col_group_values second=per_transposing_col_values
var incrementing_values = new Dictionary<int, object?[]>(); Dictionary<int, object[]> incrementing_values = new Dictionary<int, object[]>();
foreach (IBlueRow r in kvp.Value) foreach (IBlueRow r in kvp.Value)
{ {
int hash = hasher.get_hash(r, _transposing_col_indices); int hash = hasher.get_hash(r, _transposing_col_indices);
if (!incrementing_values.TryGetValue(hash, out var values)) object[] values;
if (!incrementing_values.TryGetValue(hash, out values))
{ {
incrementing_values.Add(hash, _get_per_transposing_col_values(r)); incrementing_values.Add(hash, _get_per_transposing_col_values(r));
string prefix = _get_column_prefix(_get_transposing_col_values(r)); string prefix = _get_column_prefix(_get_transposing_col_values(r));
if (!tc_prefixes.ContainsKey(hash)) if (!tc_prefixes.ContainsKey(hash))
{ {
tc_prefixes.Add(hash, prefix); tc_prefixes.Add(hash, prefix);
tc_values.Add(new(hash, _get_transposing_col_values(r))); tc_values.Add(new Pair<int,object[]>(hash, _get_transposing_col_values(r)));
} }
} }
else else
@@ -187,18 +194,18 @@ namespace BCG
_set_schema(prefixes, group_by_col_info, table_name); _set_schema(prefixes, group_by_col_info, table_name);
BlueTable result = new BlueTable(_schema); BlueTable result = new BlueTable(_schema);
int id = 1; int id = 1;
foreach (var kvp in all_tc_infos_and_values) foreach (KeyValuePair<int, Dictionary<int, object[]>> kvp in all_tc_infos_and_values)
{ {
MutableBlueRow mbr = new MutableBlueRow(_schema); MutableBlueRow mbr = new MutableBlueRow(_schema);
mbr.setValue("id", id++); mbr.setValue("id", id++);
for (int i = 0; i < _group_by_cols.Length; i++) for (int i = 0; i < _group_by_cols.Length; i++)
mbr.setValue(_group_by_cols[i], group_by_cols_value_dict[kvp.Key][i]); mbr.setValue(_group_by_cols[i], group_by_cols_value_dict[kvp.Key][i]);
foreach (var tc_cols in kvp.Value) foreach (KeyValuePair<int, object[]> tc_cols in kvp.Value)
{ {
string prefix = tc_prefixes[tc_cols.Key]; string prefix = tc_prefixes[tc_cols.Key];
for (int i = 0; i < _cols_per_transposed.Length; i++) for (int i = 0; i < _cols_per_transposed.Length; i++)
{ {
string column = _get_full_column_name(prefix, _cols_per_transposed[i].first ?? string.Empty); string column = _get_full_column_name(prefix, _cols_per_transposed[i].first);
if(mbr.schema.columnNames.Contains(column)) if(mbr.schema.columnNames.Contains(column))
mbr.setValue(column, tc_cols.Value[i]); mbr.setValue(column, tc_cols.Value[i]);
} }
@@ -210,25 +217,28 @@ namespace BCG
#endregion #endregion
object?[] _get_transposing_col_values(IBlueRow row) { private object[] _get_transposing_col_values(IBlueRow row)
var values = new object?[_transposing_cols.Length]; {
object[] values = new object[_transposing_cols.Length];
for (int i = 0; i < _transposing_cols.Length; i++) for (int i = 0; i < _transposing_cols.Length; i++)
values[i] = row[_transposing_cols[i]]; values[i] = row[_transposing_cols[i]];
return values; return values;
} }
object?[] _get_per_transposing_col_values(IBlueRow row) { private object[] _get_per_transposing_col_values(IBlueRow row)
var values = new object?[_cols_per_transposed.Length]; {
object[] values = new object[_cols_per_transposed.Length];
for (int i = 0; i < _cols_per_transposed.Length; i++) for (int i = 0; i < _cols_per_transposed.Length; i++)
values[i] = row[ExceptionAssert.NotNull(_cols_per_transposed[i].first)]; values[i] = row[_cols_per_transposed[i].first];
return values; return values;
} }
object?[] _get_group_by_cols_values(IBlueRow row) { private object[] _get_group_by_cols_values(IBlueRow row)
var values = new object?[_group_by_cols.Length]; {
object[] values = new object[_group_by_cols.Length];
for (int i = 0; i < values.Length; i++) for (int i = 0; i < values.Length; i++)
values[i] = row[_group_by_cols[i]]; values[i] = row[_group_by_cols[i]];
return values; return values;
} }
} }
} }
@@ -1,19 +1,22 @@
using Spark.Core.Diagnostics; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BCG namespace BCG
{ {
public class DerivativeStream : ViewStream public class DerivativeStream : ViewStream
{ {
IBlueTableSchema? mySchema;
private IBlueTableSchema mySchema;
private string myDerivandColumn; private string myDerivandColumn;
private string myOutputColumn; private string myOutputColumn;
private string myKeyColumn; private string myKeyColumn;
private DateTime myLastPacketArrival = DateTime.MinValue; private DateTime myLastPacketArrival = DateTime.MinValue;
private ViewStream myDataSource; private ViewStream myDataSource;
Dictionary<string, double>? myPreviousValues;
private IDictionary<string, double> myPreviousValues;
public DerivativeStream(ViewStream input, string keyColumn, string columnToDifferentiate, string outputColName) public DerivativeStream(ViewStream input, string keyColumn, string columnToDifferentiate, string outputColName)
{ {
@@ -36,9 +39,9 @@ namespace BCG
void myDataSource_onChange(object newValue) void myDataSource_onChange(object newValue)
{ {
var dp = (IDataPacket)newValue; DataPacket dp = (DataPacket)newValue;
if (myLastPacketArrival == DateTime.MinValue) if (myLastPacketArrival == DateTime.MinValue)
mySchema = myBuildOutputSchema(dp.Schema); mySchema = myBuildOutputSchema(dp.schema);
else else
{ {
DateTime now = DateTime.Now; DateTime now = DateTime.Now;
@@ -52,7 +55,7 @@ namespace BCG
else else
{ {
IBlueRowCollection deleted, added; IBlueRowCollection deleted, added;
BlueDataUtility.computeDifferences(thisVersion, ((IDataPacket)myLastValue).newRows, out deleted, out added); BlueDataUtility.computeDifferences(thisVersion, ((DataPacket)myLastValue).newRows, out deleted, out added);
myFireEvent(new DataPacket(thisVersion, added, deleted)); myFireEvent(new DataPacket(thisVersion, added, deleted));
} }
} }
@@ -61,13 +64,12 @@ namespace BCG
protected IBlueRow myMakeRow(IBlueRow r, double timeScale) protected IBlueRow myMakeRow(IBlueRow r, double timeScale)
{ {
ExceptionAssert.NotNull(mySchema, myPreviousValues);
object[] outValues = new object[mySchema.columnInfo.Length]; object[] outValues = new object[mySchema.columnInfo.Length];
r.Values.CopyTo(outValues, 0); r.Values.CopyTo(outValues, 0);
var derivand = r[myDerivandColumn]; object derivand = r[myDerivandColumn];
var key = getRowKey(r); double lastValue = default(double);
if (myPreviousValues.TryGetValue(key, out double lastValue) && derivand != null && derivand != DBNull.Value) if (myPreviousValues.TryGetValue(r[myKeyColumn].ToString(), out lastValue) && derivand != null && derivand != DBNull.Value)
outValues[mySchema.columnInfo.Length - 1] = (Convert.ToDouble(derivand) - lastValue) * timeScale; outValues[mySchema.columnInfo.Length - 1] = (Convert.ToDouble(derivand) - lastValue) * timeScale;
else else
outValues[mySchema.columnInfo.Length - 1] = 0.0; outValues[mySchema.columnInfo.Length - 1] = 0.0;
@@ -82,19 +84,16 @@ namespace BCG
cols[cols.Length - 1] = new ColumnInfo(myOutputColumn, cols.Length - 1, typeof(double)); cols[cols.Length - 1] = new ColumnInfo(myOutputColumn, cols.Length - 1, typeof(double));
return new BlueTableSchema("derviative of " + inSchema.tableName, cols); return new BlueTableSchema("derviative of " + inSchema.tableName, cols);
} }
protected void myStoreNewPacketInfo(DataPacket dp)
protected void myStoreNewPacketInfo(IDataPacket dp) { {
myPreviousValues = new Dictionary<string, double>(); myPreviousValues = new Dictionary<string, double>();
myLastPacketArrival = DateTime.Now; myLastPacketArrival = DateTime.Now;
foreach (IBlueRow row in dp.newRows) foreach (IBlueRow row in dp.newRows)
{ {
var derivand = row[myDerivandColumn]; object derivand = row[myDerivandColumn];
if (derivand != null && derivand != DBNull.Value) if (derivand != null && derivand != DBNull.Value)
myPreviousValues[getRowKey(row)] = Convert.ToDouble(derivand); myPreviousValues[row[myKeyColumn].ToString()] = Convert.ToDouble(derivand);
} }
} }
string getRowKey(IBlueRow row) =>
row[myKeyColumn]?.ToString() ?? throw new ArgumentException("Row key is null", nameof(row));
} }
} }
@@ -1,9 +1,7 @@
using mbts; using System;
using System.Collections;
using Spark.Core.Collections;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using mbts;
namespace BCG namespace BCG
{ {
@@ -14,9 +12,9 @@ namespace BCG
{ {
ViewStream myLStream, myRStream; ViewStream myLStream, myRStream;
DataPacket? myLastR; DataPacket myLastR = null, myLastL = null;
DataPacket? myLastL;
BlueTable? myLastFired; BlueTable myLastFired = null;
double myThreshold = .00005; double myThreshold = .00005;
@@ -26,14 +24,14 @@ namespace BCG
public DiffStream(ViewStream v1, ViewStream v2, double thresh, params string[] ColumnsToMatch) : public DiffStream(ViewStream v1, ViewStream v2, double thresh, params string[] ColumnsToMatch) :
this(null, v1, v2, thresh, ColumnsToMatch) { } this(null, v1, v2, thresh, ColumnsToMatch) { }
public DiffStream(ViewStreamDatabase? db, ViewStream v1, ViewStream v2, double thresh, params string[] columnsToMatch) public DiffStream(ViewStreamDatabase db, ViewStream v1, ViewStream v2, double thresh, params string[] columnsToMatch)
{ {
myThreshold = thresh; myThreshold = thresh;
myLStream = v1; myLStream = v1;
myRStream = v2; myRStream = v2;
myColumnsToMatch = columnsToMatch; myColumnsToMatch = columnsToMatch;
} }
public DiffStream(ViewStreamDatabase? db, ViewStream v1, ViewStream v2, params string[] columnsToMatch) public DiffStream(ViewStreamDatabase db, ViewStream v1, ViewStream v2, params string[] columnsToMatch)
: this(db,v1,v2,.00005,columnsToMatch) : this(db,v1,v2,.00005,columnsToMatch)
{ {
} }
@@ -52,22 +50,45 @@ namespace BCG
myRStream.onChange -= myRChange; myRStream.onChange -= myRChange;
} }
struct ListComparer : IEqualityComparer<List<object>>
{
public bool Equals(List<object> x, List<object> y)
{
if (x.Count != y.Count)
return false;
for (int i = 0; i < x.Count; ++i)
if (!x[i].Equals(y[i]))
return false;
return true;
}
public int GetHashCode(List<object> obj)
{
int ret = 0;
for(int i = 0; i < obj.Count; ++i)
ret ^= obj[i].GetHashCode();
return ret;
}
}
void myHandleCallbacks() void myHandleCallbacks()
{ {
DataPacket? packet; DataPacket packet = null;
if (myLastL == null || myLastR == null) if (myLastL == null || myLastR == null)
{ {
packet = myLastL == null ? myLastR : myLastL; packet = myLastL == null ? myLastR : myLastL;
if (packet is not null) { if (packet != null)
myFireEvent(packet); myFireEvent(packet);
myLastFired = new BlueTable(packet.newRows);
} myLastFired = new BlueTable(packet.newRows);
return; return;
} }
BlueTable table = new BlueTable(myLastL.newRows.schema); BlueTable table = new BlueTable(myLastL.newRows.schema);
var rowPairs = new Dictionary<List<object>, Pair<BlueRow, BlueRow>>(EnumerableComparer.Create<object>()); Dictionary<List<object>, Pair<BlueRow, BlueRow>> rowPairs = new Dictionary<List<object>, Pair<BlueRow, BlueRow>>(new ListComparer());
foreach(BlueRow row in myLastL.newRows) foreach(BlueRow row in myLastL.newRows)
{ {
@@ -97,7 +118,11 @@ namespace BCG
} }
catch (Exception) { } catch (Exception) { }
} }
rowPairs.TryGetValue(hash, out var pair);
Pair<BlueRow, BlueRow> pair;
rowPairs.TryGetValue(hash, out pair);
if (pair == null) if (pair == null)
pair = new Pair<BlueRow, BlueRow>(null, row); pair = new Pair<BlueRow, BlueRow>(null, row);
else else
@@ -113,7 +138,8 @@ namespace BCG
if (pair.first == null || pair.second == null) if (pair.first == null || pair.second == null)
{ {
var row = pair.first ?? pair.second ?? throw new InvalidOperationException("Both rows in rowPair are null"); BlueRow row = pair.first == null ? pair.second : pair.first;
Dictionary<string, object> newRow = new Dictionary<string, object>(); Dictionary<string, object> newRow = new Dictionary<string, object>();
foreach (ColumnInfo info in row.schema.columnInfo) foreach (ColumnInfo info in row.schema.columnInfo)
{ {
@@ -185,4 +211,4 @@ namespace BCG
} }
} }
@@ -14,8 +14,10 @@ namespace BCG
public DistinctRowEvaluator(string colMapExpression, string[] columnNames) public DistinctRowEvaluator(string colMapExpression, string[] columnNames)
: base (colMapExpression, null, columnNames) {} : base (colMapExpression, null, columnNames) {}
public override IBlueRow? evaluate(IDataPacket packet) {
myOutputTable ??= new GroupByOutputTable(packet.Schema); public override IBlueRow evaluate (DataPacket packet)
{
myOutputTable = myOutputTable == null ? new GroupByOutputTable (packet.schema) : myOutputTable;
string hashString = GroupByStream.getRepString (packet, myGroupByCols); string hashString = GroupByStream.getRepString (packet, myGroupByCols);
if (packet.newRows.Count == 0) if (packet.newRows.Count == 0)
//if there are no rows for this group we remove the group from the output table //if there are no rows for this group we remove the group from the output table
@@ -5,7 +5,7 @@ namespace BCG
{ {
public class FileViewStream : ViewStream public class FileViewStream : ViewStream
{ {
DataPacket? myDp; private DataPacket myDp;
public FileViewStream (string dataFileName, public FileViewStream (string dataFileName,
string schemaFileName) string schemaFileName)
: this (dataFileName, schemaFileName, Int32.MaxValue) : this (dataFileName, schemaFileName, Int32.MaxValue)
@@ -1,7 +1,8 @@
using BCG.Utilities.General; using System;
using System.Collections.Generic;
using System; using System.Linq;
using System.Text;
using BCG.Utilities.General;
namespace BCG namespace BCG
{ {
public class DateBasedFilter: IDynamicStreamFilter, IWorker public class DateBasedFilter: IDynamicStreamFilter, IWorker
@@ -25,14 +26,20 @@ namespace BCG
myReference = myTodaysDate.AddDays(-1 * myNDays); myReference = myTodaysDate.AddDays(-1 * myNDays);
} }
public event FilterChangeDelegate? onFilterChange; public event FilterChangeDelegate onFilterChange;
public bool filter(IBlueRow r) => public bool filter(IBlueRow r)
r[myDateColumn] switch { {
DBNull or null => true, if (DBNull.Value.Equals(r[myDateColumn]))
DateTime t => t >= myReference, {
_ => throw new ArgumentException("Row has invalid date column value", nameof(r)), //return false;
}; return true; //it can be considered as our assumption whenever datecolumn is db null we return true
}
DateTime t = (DateTime)r[myDateColumn];
bool returnVallue = t < myReference ? false : true;
return returnVallue;
}
public void doWork() public void doWork()
{ {
@@ -40,7 +47,7 @@ namespace BCG
{ {
myTodaysDate = DateTime.Today; myTodaysDate = DateTime.Today;
myReference = myTodaysDate.AddDays(-1 * myNDays); myReference = myTodaysDate.AddDays(-1 * myNDays);
onFilterChange?.Invoke(); onFilterChange();
} }
} }
} }
@@ -1,6 +1,8 @@
using BCG.Utilities.General; using System;
using System.Collections.Generic;
using System; using System.Linq;
using System.Text;
using BCG.Utilities.General;
namespace BCG namespace BCG
{ {
@@ -24,7 +26,7 @@ namespace BCG
#region IDynamicStreamFilter Members #region IDynamicStreamFilter Members
public event FilterChangeDelegate? onFilterChange; public event FilterChangeDelegate onFilterChange;
#endregion #endregion
@@ -32,10 +34,7 @@ namespace BCG
public bool filter(IBlueRow r) public bool filter(IBlueRow r)
{ {
DateTime rowDate = r[myDateColName] switch { DateTime rowDate = DBNull.Value.Equals (r[myDateColName]) ? DateTime.Now.Date : ((DateTime)r[myDateColName]).Date;
DBNull or null => DateTime.Now.Date,
object obj => (DateTime)obj,
};
DateTime today = DateTime.Now.Date; DateTime today = DateTime.Now.Date;
return rowDate > today ? true : !(today.Subtract(rowDate).Days >= myNPastTodayDays); return rowDate > today ? true : !(today.Subtract(rowDate).Days >= myNPastTodayDays);
} }
@@ -49,7 +48,7 @@ namespace BCG
if (DateTime.Now.Date != myLastCheckedTime.Date) if (DateTime.Now.Date != myLastCheckedTime.Date)
{ {
myLastCheckedTime = DateTime.Now; myLastCheckedTime = DateTime.Now;
onFilterChange?.Invoke(); onFilterChange();
} }
} }
@@ -1,23 +1,15 @@
using bts; using Bts.DataStream;
using Bts.DataStream.Primitives.Filter; using mbts.config;
using Bts.DataStreamCore;
using Spark.Core.Diagnostics;
using Spark.Core.Disposables;
using System; using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace BCG.StreamWorld.Addition { namespace BCG.StreamWorld.Addition {
[DataStreamUserRespresentation(false)] [DataStreamUserRespresentation(false)]
public class FilterStream : ViewStream { public class FilterStream : ViewStream {
private ViewStream myBaseStream; private ViewStream myBaseStream;
BlueTable? myBaseTable; private BlueTable myBaseTable, myStateTable;
BlueTable? myStateTable;
private IStreamFilter myFilter; private IStreamFilter myFilter;
public FilterStream(ViewStream vs) public FilterStream(ViewStream vs)
@@ -29,9 +21,8 @@ namespace BCG.StreamWorld.Addition {
public FilterStream(ViewStream vs, IStreamFilter filter) { public FilterStream(ViewStream vs, IStreamFilter filter) {
myBaseStream = vs; myBaseStream = vs;
myFilter = filter; myFilter = filter;
vs.ErrorChanged += OnError; if (filter is IDynamicStreamFilter)
if (filter is IDynamicStreamFilter dfilter) (filter as IDynamicStreamFilter).onFilterChange += new FilterChangeDelegate(myHandleFilterChange);
dfilter.onFilterChange += myHandleFilterChange;
} }
@@ -41,69 +32,46 @@ namespace BCG.StreamWorld.Addition {
protected override void myOnLastSubscriber() { protected override void myOnLastSubscriber() {
myBaseStream.onChange -= new ChangeDelegate(myHandleChanges); myBaseStream.onChange -= new ChangeDelegate(myHandleChanges);
myBaseTable?.clear(); myBaseTable.clear();
myStateTable?.clear(); myStateTable.clear();
}
bool filterRow(IBlueRow r) {
try {
return myFilter.filter(r);
} catch (Exception ex) {
Log.Gen.error($"FilterStream delegate threw exception: {ex}");
OnError(new StreamFilterException(StreamId, StreamName, null, ex, r));
}
return false;
} }
private void myHandleChanges(object newValue) { private void myHandleChanges(object newValue) {
try { DataPacket dp = newValue as DataPacket;
var dp = (IDataPacket)newValue; if (myStateTable == null) {
var schema = dp.Schema; bts.Log.assert(myBaseTable == null);
init(schema); myStateTable = new BlueTable(dp.schema);
var dels = new BlueTable(schema); myBaseTable = new BlueTable(dp.schema);
var adds = new BlueTable(schema);
foreach (IBlueRow r in dp.deletedRows) {
myBaseTable.deleteRow(r);
if (myStateTable.containsID(r.Id())) {
dels.addRow(r);
myStateTable.deleteRow(r);
}
}
foreach (IBlueRow r in dp.addedRows) {
myBaseTable.addRow(r);
if (filterRow(r)) {
adds.addRow(r);
myStateTable.addRow(r);
}
}
if ((dels.Count > 0 || adds.Count > 0) || (myLastValue == null))
myFireEvent(new DataPacket(myStateTable, adds, dels));
} catch (Exception ex) {
OnError(ex);
} }
BlueTable dels = new BlueTable(dp.schema),
adds = new BlueTable(dp.schema);
foreach (IBlueRow r in dp.deletedRows) {
myBaseTable.deleteRow(r);
if (myStateTable.containsID((int)r["id"])) {
dels.addRow(r);
myStateTable.deleteRow(r);
}
}
foreach (IBlueRow r in dp.addedRows) {
myBaseTable.addRow(r);
if (myFilter.filter(r)) {
adds.addRow(r);
myStateTable.addRow(r);
}
}
if ((dels.Count > 0 || adds.Count > 0) || (myLastValue == null))
myFireEvent(new DataPacket(myStateTable, adds, dels));
} }
public IStreamFilter filter { public IStreamFilter filter {
set { set {
myFilter = value; myFilter = value;
if (myBaseTable != null) { if (myBaseTable != null) {
ExceptionAssert.NotNull(myStateTable);
IBlueRowCollection oldState = new BlueTable(myStateTable); IBlueRowCollection oldState = new BlueTable(myStateTable);
myStateTable.clear(); myStateTable.clear();
// If the filter throws an exception, we can rethrow it as a StreamFilterException foreach (IBlueRow r in myBaseTable)
// and include the 'currentRow' (for which the filter failed) to provide context. if (myFilter.filter(r))
IBlueRow? currentRow = null; myStateTable.addRow(r);
foreach (IBlueRow r in myBaseTable) {
try {
currentRow = r;
if (filterRow(r)) {
myStateTable.addRow(r);
}
} catch (Exception ex) {
Log.Gen.error($"FilterStream delegate threw exception: {ex}");
OnError(new StreamFilterException(StreamId, StreamName, null, ex, currentRow));
}
}
IBlueRowCollection dels, adds; IBlueRowCollection dels, adds;
BlueDataUtility.computeDifferences(myStateTable, oldState, out dels, out adds); BlueDataUtility.computeDifferences(myStateTable, oldState, out dels, out adds);
myFireEvent(new DataPacket(myStateTable, adds, dels)); myFireEvent(new DataPacket(myStateTable, adds, dels));
@@ -115,17 +83,6 @@ namespace BCG.StreamWorld.Addition {
//public string filterString { set { filter = new BooleanExpressionFilter(value); } } //public string filterString { set { filter = new BooleanExpressionFilter(value); } }
private void myHandleFilterChange() { filter = myFilter; } private void myHandleFilterChange() { filter = myFilter; }
[MemberNotNull(nameof(myStateTable), nameof(myBaseTable))]
void init(IBlueTableSchema schema) {
if (myStateTable is null) {
Log.isnull(myBaseTable);
myStateTable = new BlueTable(schema);
myBaseTable = new BlueTable(schema);
} else {
Log.notnull(myBaseTable);
}
}
} }
} }
@@ -149,24 +106,29 @@ namespace BCG
} }
#region IStreamFilter Members #region IStreamFilter Members
public bool filter(IBlueRow dr) => public bool filter(IBlueRow dr)
myCols.Zip(myRegExps).All(p => p.Second.IsMatch(dr[p.First] switch { {
DBNull or null => string.Empty, bool rv = true;
object obj => obj.ToString() ?? string.Empty for (int i = 0; i < myCols.Length; i++)
})); {
rv &= myRegExps[i].IsMatch(dr[myCols[i]] is DBNull ? "" : dr[myCols[i]].ToString());
if (!rv)
return rv;
}
return rv;
}
#endregion #endregion
} }
public class FilterStream : ViewStream public class FilterStream : ViewStream
{ {
BlueTable? myLastFiredRows; private BlueTable myLastFiredRows;
IBlueRowCollection? myLastReceivedRows; private IBlueRowCollection myLastReceivedRows;
IStreamFilter? myFilter; private IStreamFilter myFilter;
readonly ViewStream? myParentStream; private ViewStream myParentStream;
string? myFilterString; private string myFilterString;
readonly StreamWorld.Addition.FilterStream? myFilterStream; private BCG.StreamWorld.Addition.FilterStream myFilterStream;
readonly bool myUseNewFilter = false; private bool myUseNewFilter = Configuration.get<DataStreamConfig>().UseNewFilter;
IDisposable? subscription;
#region constructors #region constructors
public delegate bool OnFilter(IBlueRow r); public delegate bool OnFilter(IBlueRow r);
@@ -196,10 +158,9 @@ namespace BCG
{ {
myParentStream = vs; myParentStream = vs;
myFilter = filter; myFilter = filter;
myFilterString = filter.ToString() ?? string.Empty; myFilterString = filter.ToString();
if (filter is IDynamicStreamFilter dfilter) { if (filter is IDynamicStreamFilter)
dfilter.onFilterChange += myHandleFilterChange; (filter as IDynamicStreamFilter).onFilterChange += new FilterChangeDelegate(myHandleFilterChange);
}
} }
} }
@@ -223,20 +184,18 @@ namespace BCG
#endregion #endregion
#region overridden methods #region overridden methods
protected override void myOnFirstSubscriber() { protected override void myOnFirstSubscriber()
ExceptionAssert.IsNull(subscription); { myParentStream.onChange += new ChangeDelegate(myHandleCallbacks); }
subscription = ExceptionAssert.NotNull(myParentStream).Subscribe(myHandleCallbacks);
}
protected override void myOnLastSubscriber() protected override void myOnLastSubscriber()
{ {
myLastFiredRows = null; myLastFiredRows = null;
Disposable.Dispose(ref subscription); myParentStream.onChange -= new ChangeDelegate(myHandleCallbacks);
} }
protected override void myFireEvent(object o) protected override void myFireEvent(object o)
{ {
var dp = (IDataPacket)o; DataPacket dp = o as DataPacket;
if (myLastValue == null || dp.addedRows.Count + dp.deletedRows.Count > 0) if (myLastValue == null || dp.addedRows.Count + dp.deletedRows.Count > 0)
base.myFireEvent(o); base.myFireEvent(o);
} }
@@ -245,39 +204,34 @@ namespace BCG
private void myHandleCallbacks(object newValue) private void myHandleCallbacks(object newValue)
{ {
DataPacket retVal; DataPacket retVal;
var arrivedPacket = (IDataPacket)newValue; DataPacket arrivedPacket = newValue as DataPacket;
myLastReceivedRows = arrivedPacket.newRows; myLastReceivedRows = arrivedPacket.newRows;
try { if (myLastFiredRows != null)
if (myLastFiredRows != null) {
{ retVal = new DataPacket(myLastFiredRows, new BlueTable(myLastFiredRows.schema),
var addedRows = new BlueTable(myLastFiredRows.schema); new BlueTable(myLastFiredRows.schema));
var deletedRows = new BlueTable(myLastFiredRows.schema); foreach (IBlueRow r in arrivedPacket.deletedRows)
retVal = new DataPacket(myLastFiredRows, addedRows, deletedRows); if (myLastFiredRows.containsID((int)r["id"]))
foreach (IBlueRow r in arrivedPacket.deletedRows) {
if (myLastFiredRows.containsID(r.Id())) myLastFiredRows.deleteRow(r);
{ (retVal.deletedRows as BlueTable).addRow(r);
myLastFiredRows.deleteRow(r); }
deletedRows.addRow(r); foreach (IBlueRow r in arrivedPacket.addedRows)
} if (myFilter.filter(r))
foreach (IBlueRow r in arrivedPacket.addedRows) {
if (filterRow(r)) myLastFiredRows.addRow(r);
{ (retVal.addedRows as BlueTable).addRow(r);
myLastFiredRows.addRow(r); }
addedRows.addRow(r);
}
}
else
{
myLastFiredRows = new BlueTable(arrivedPacket.Schema);
retVal = new DataPacket(myLastFiredRows, myLastFiredRows, new BlueTable(myLastFiredRows.schema));
foreach (IBlueRow r in arrivedPacket.newRows)
if (filterRow(r))
myLastFiredRows.addRow(r);
}
myFireEvent(retVal);
} catch (Exception ex) {
OnError(ex);
} }
else
{
myLastFiredRows = new BlueTable(arrivedPacket.schema);
retVal = new DataPacket(myLastFiredRows, myLastFiredRows, new BlueTable(myLastFiredRows.schema));
foreach (IBlueRow r in arrivedPacket.newRows)
if (myFilter.filter(r))
myLastFiredRows.addRow(r);
}
myFireEvent(retVal);
} }
public IStreamFilter filter public IStreamFilter filter
@@ -286,7 +240,7 @@ namespace BCG
{ {
if (myUseNewFilter) if (myUseNewFilter)
{ {
requireNewFilter().filter = filter; myFilterStream.filter = filter;
} }
else else
{ {
@@ -295,29 +249,25 @@ namespace BCG
{ {
if (myLastReceivedRows != null) if (myLastReceivedRows != null)
{ {
try {
BlueTable nRows = new BlueTable(myLastReceivedRows.schema); BlueTable nRows = new BlueTable(myLastReceivedRows.schema);
foreach (IBlueRow r in myLastReceivedRows) foreach (IBlueRow r in myLastReceivedRows)
if (filterRow(r)) if (myFilter.filter(r))
nRows.addRow(r); nRows.addRow(r);
IBlueRowCollection dRows = new BlueTable(nRows.schema), IBlueRowCollection dRows = new BlueTable(nRows.schema),
aRows = new BlueTable(nRows.schema); aRows = new BlueTable(nRows.schema);
BlueDataUtility.computeDifferences(nRows, myLastFiredRows, out dRows, out aRows); BlueDataUtility.computeDifferences(nRows, myLastFiredRows, out dRows, out aRows);
myLastFiredRows = nRows; myLastFiredRows = nRows;
myFireEvent(new DataPacket(nRows, aRows, dRows)); myFireEvent(new DataPacket(nRows, aRows, dRows));
} catch (Exception ex) { }
OnError(ex);
}
}
} }
} }
} }
get get
{ {
if (myUseNewFilter) if (myUseNewFilter)
return requireNewFilter().filter; return myFilterStream.filter;
else else
return requireOldFilter(); return myFilter;
} }
} }
@@ -330,25 +280,7 @@ namespace BCG
private void myHandleFilterChange() private void myHandleFilterChange()
{ {
filter = requireOldFilter(); filter = myFilter;
} }
bool filterRow(IBlueRow r) {
try {
return requireOldFilter().filter(r);
} catch (Exception ex) {
Log.Gen.error($"FilterStream delegate threw exception: {ex}");
OnError(new StreamFilterException(StreamId, StreamName, null, ex, r));
}
return false;
}
[MemberNotNull(nameof(myFilterStream))]
StreamWorld.Addition.FilterStream requireNewFilter() =>
ExceptionAssert.MemberNotNull(myFilterStream);
[MemberNotNull(nameof(myFilter))]
IStreamFilter requireOldFilter() =>
ExceptionAssert.MemberNotNull(myFilter);
} }
} }
@@ -1,6 +1,8 @@
using BCG.Utilities.General; using System;
using System.Collections.Generic;
using System; using System.Linq;
using System.Text;
using BCG.Utilities.General;
namespace BCG namespace BCG
{ {
@@ -27,7 +29,7 @@ namespace BCG
myReference = myCurrentTime.AddSeconds(-1 * myNSecs); myReference = myCurrentTime.AddSeconds(-1 * myNSecs);
} }
public event FilterChangeDelegate? onFilterChange; public event FilterChangeDelegate onFilterChange;
public bool filter(IBlueRow r) public bool filter(IBlueRow r)
{ {
@@ -36,8 +38,9 @@ namespace BCG
//it can be considered as our assumption whenever datecolumn is db null we return true //it can be considered as our assumption whenever datecolumn is db null we return true
return true; //dont use this for volparamsched use true return true; //dont use this for volparamsched use true
} }
var t = (DateTime)r[myDateColumn]!; DateTime t = (DateTime)r[myDateColumn];
return t >= myReference; bool returnVallue = t < myReference ? false : true;
return returnVallue;
} }
@@ -48,7 +51,8 @@ namespace BCG
myCurrentTime = DateTime.Now; myCurrentTime = DateTime.Now;
myReference = myCurrentTime.AddSeconds(-1 * myNSecs); myReference = myCurrentTime.AddSeconds(-1 * myNSecs);
myLastTimeFilteredApplied = DateTime.Now; myLastTimeFilteredApplied = DateTime.Now;
onFilterChange?.Invoke(); onFilterChange();
} }
} }
} }
@@ -1,19 +0,0 @@
#nullable enable
namespace Bts.DataStream.Primitives.Filter;
using BCG;
using System;
public class StreamFilterException : Exception {
public StreamFilterException(Guid streamId, string streamName, string? message, Exception? innerException, IBlueRow? badRow = null)
: base(message, innerException) {
StreamId = streamId;
StreamName = streamName;
BadRow = badRow;
}
public Guid StreamId { get; }
public string StreamName { get; }
public IBlueRow? BadRow { get; }
}
@@ -71,10 +71,11 @@ namespace BCG {
#region IStreamFilter #region IStreamFilter
public bool filter(IBlueRow row) { public bool filter(IBlueRow row) {
DateTime now_utc = DateTime.UtcNow; DateTime now = DateTime.Now;
DateTime row_time_utc = row.get_datetime(_time_col, DateTime.Now).ToUniversalTime();
if (now_utc > row_time_utc) { DateTime row_time = row.get_datetime(_time_col, DateTime.Now);
TimeSpan span = now_utc - row_time_utc; if (now > row_time) {
TimeSpan span = now - row_time;
if (span >= _ttl) { if (span >= _ttl) {
return (false); return (false);
} }
@@ -89,7 +90,7 @@ namespace BCG {
if (now > myNextFilter) { if (now > myNextFilter) {
// fire event // fire event
onFilterChange?.Invoke(); onFilterChange();
myNextFilter = now.Add(_filter_period); myNextFilter = now.Add(_filter_period);
} }
@@ -1,13 +1,11 @@
using BCG.Utilities.General; using System;
using Spark.Core.Diagnostics;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text;
using BCG.Utilities.General;
using FuzzyRowComparer = System.Func<BCG.IBlueRow, BCG.IBlueRow, double>; using FuzzyRowComparer = System.Func<BCG.IBlueRow, BCG.IBlueRow, double>;
using System.Diagnostics;
namespace BCG namespace BCG
{ {
@@ -42,12 +40,12 @@ namespace BCG
private IComparer<IBlueRow> myRightCompare; private IComparer<IBlueRow> myRightCompare;
protected FuzzyRowComparer myFuzzyCompare; protected FuzzyRowComparer myFuzzyCompare;
protected TimeSpan myTimeWindow; protected TimeSpan myTimeWindow;
protected IBlueTableSchema? myLeftSchema; protected IBlueTableSchema myLeftSchema;
protected IBlueTableSchema? myRightSchema; protected IBlueTableSchema myRightSchema;
protected IBlueTableSchema? myOutputSchema; protected IBlueTableSchema myOutputSchema;
private int myID = 0; private int myID = 0;
protected TimeWindowTable? myStateRows; protected TimeWindowTable myStateRows;
private DateTime myNextCull; private DateTime myNextCull;
const long MinCullIntervalMS = 1000; const long MinCullIntervalMS = 1000;
@@ -67,7 +65,7 @@ namespace BCG
this.myFuzzyCompare = fuzzyCompare; this.myFuzzyCompare = fuzzyCompare;
} }
public virtual IBlueTableSchema? OutputSchema public virtual IBlueTableSchema OutputSchema
{ {
get get
{ {
@@ -152,7 +150,7 @@ namespace BCG
int count; int count;
for (count = 0; count < list.Count; count++) for (count = 0; count < list.Count; count++)
{ {
if ((DateTime)list[count][timeColumn]! > expiry) if ((DateTime)list[count][timeColumn] > expiry)
{ {
// Stop when we find the first row that we can keep. Since this is sorted all others are also kept. // Stop when we find the first row that we can keep. Since this is sorted all others are also kept.
break; break;
@@ -174,16 +172,16 @@ namespace BCG
this.myFitness = fitness; this.myFitness = fitness;
} }
public IBlueRow myRightRow { get; private set; } public IBlueRow myRightRow { get; private set; }
public IBlueRow? myLeftRow { get; set; } public IBlueRow myLeftRow { get; set; }
public double myFitness { get; private set; } public double myFitness { get; private set; }
public IBlueRow? myMergedRow { get; set; } public IBlueRow myMergedRow { get; set; }
#region IComparable<RowMatch> Members #region IComparable<RowMatch> Members
public int CompareTo(RowMatch? other) => public int CompareTo(RowMatch other)
other is null {
? 1 return myFitness.CompareTo(other.myFitness);
: myFitness.CompareTo(other.myFitness); }
#endregion #endregion
} }
@@ -264,12 +262,12 @@ namespace BCG
private void HandleCorrection(List<RowMatch> corrections, BlueTable adds, BlueTable dels) private void HandleCorrection(List<RowMatch> corrections, BlueTable adds, BlueTable dels)
{ {
ExceptionAssert.NotNull(myStateRows);
// We already emitted correction.MergedRow so we need to redact that and // We already emitted correction.MergedRow so we need to redact that and
// then emit correction.left as an add since it is no longer matched // then emit correction.left as an add since it is no longer matched
foreach (RowMatch correction in corrections.Distinct()) foreach (RowMatch correction in corrections.Distinct())
{ {
myStateRows.RemoveRow(ExceptionAssert.NotNull(correction.myMergedRow)); Debug.Assert(correction.myMergedRow != null);
this.myStateRows.RemoveRow(correction.myMergedRow);
adds.addRow(this.MergeRows(correction.myLeftRow, null)); adds.addRow(this.MergeRows(correction.myLeftRow, null));
dels.addRow(correction.myMergedRow); dels.addRow(correction.myMergedRow);
} }
@@ -287,7 +285,7 @@ namespace BCG
int r = 0; int r = 0;
for (l = 0, r = 0; l < leftExpired.Length && r < rightExpired.Length; ) for (l = 0, r = 0; l < leftExpired.Length && r < rightExpired.Length; )
{ {
if ((DateTime)leftExpired[l][this.myLeftTimeColumn]! <= (DateTime)rightExpired[r][this.myRightTimeColumn]!) if ((DateTime)leftExpired[l][this.myLeftTimeColumn] <= (DateTime)rightExpired[r][this.myRightTimeColumn])
{ {
// Advance Left // Advance Left
IEnumerable<RowMatch> rm = rightMatches[l]; IEnumerable<RowMatch> rm = rightMatches[l];
@@ -334,7 +332,7 @@ namespace BCG
private IBlueRow MergeLeftWithBestRight(IBlueRow leftRow, IEnumerable<RowMatch> rightMatches) private IBlueRow MergeLeftWithBestRight(IBlueRow leftRow, IEnumerable<RowMatch> rightMatches)
{ {
IBlueRow? merged = null; IBlueRow merged = null;
if (rightMatches != null) if (rightMatches != null)
{ {
foreach (RowMatch match in rightMatches) foreach (RowMatch match in rightMatches)
@@ -368,9 +366,9 @@ namespace BCG
/// Override this function to provide a custom row merge. /// Override this function to provide a custom row merge.
/// The overrided function must add a new column called FuzzyJoinOverTimeStream.NEW_TIME_COLUMN which will contain a timestamp for sorting. /// The overrided function must add a new column called FuzzyJoinOverTimeStream.NEW_TIME_COLUMN which will contain a timestamp for sorting.
/// </summary> /// </summary>
protected virtual IBlueRow MergeRows(IBlueRow? left, IBlueRow? right) protected virtual IBlueRow MergeRows(IBlueRow left, IBlueRow right)
{ {
Dictionary<string, object?> newRow = new(); Dictionary<string, object> newRow = new Dictionary<string, object>();
if (left == null && right == null) throw new ArgumentException("oh come on."); if (left == null && right == null) throw new ArgumentException("oh come on.");
@@ -395,15 +393,14 @@ namespace BCG
} }
} }
newRow["id"] = this.myID++; newRow["id"] = this.myID++;
newRow[NEW_TIME_COLUMN] = left is not null newRow[NEW_TIME_COLUMN] = (left != null) ? left[this.myLeftTimeColumn] : right[this.myRightTimeColumn];
? left[myLeftTimeColumn]
: right![myRightTimeColumn];
return new BlueRow(this.OutputSchema, newRow); return new BlueRow(this.OutputSchema, newRow);
} }
private IEnumerable<RowMatch> FindMatches(IBlueRow row, List<IBlueRow> list, List<RowMatch> corrections) private IEnumerable<RowMatch> FindMatches(IBlueRow row, List<IBlueRow> list, List<RowMatch> corrections)
{ {
List<RowMatch>? matches = null; List<RowMatch> matches = null;
// Search through all rows in list and compare with the fuzzy comparer // Search through all rows in list and compare with the fuzzy comparer
for (int x = 0; x < list.Count; x++) for (int x = 0; x < list.Count; x++)
@@ -424,7 +421,8 @@ namespace BCG
matches.Insert(insertIndex >= 0 ? insertIndex : ~insertIndex, currentMatch); matches.Insert(insertIndex >= 0 ? insertIndex : ~insertIndex, currentMatch);
// Mark the best match for this particular right hand match // Mark the best match for this particular right hand match
if (this.myBestMatch.TryGetValue(match, out var oldMatch)) RowMatch oldMatch;
if (this.myBestMatch.TryGetValue(match, out oldMatch))
{ {
if (currentMatch.myFitness < oldMatch.myFitness) if (currentMatch.myFitness < oldMatch.myFitness)
{ {
@@ -443,7 +441,7 @@ namespace BCG
} }
} }
return matches ?? Enumerable.Empty<RowMatch>(); return matches;
} }
} }
} }
@@ -42,7 +42,7 @@ namespace BCG
return retVal; return retVal;
} }
public abstract IBlueRow? evaluate(IDataPacket dp); public abstract IBlueRow evaluate (DataPacket dp) ;
#endregion #endregion
#region Helper methods #region Helper methods
@@ -69,7 +69,14 @@ namespace BCG
protected IBlueRow myProject (IBlueRow r) {return myProject (r, r == null ? Int32.MinValue : (int)r["id"]);} protected IBlueRow myProject (IBlueRow r) {return myProject (r, r == null ? Int32.MinValue : (int)r["id"]);}
#endregion #endregion
IBlueRow myProjectRow (IBlueRow r, string colMapExpression) => private IBlueRow myProjectRow (IBlueRow r, string colMapExpression)
new ProjectedRow(r, new ProjectHelper(r.schema, colMapExpression, "GroupByEvaluator_Project")); {
BlueTable auxTable = new BlueTable (r.schema);
auxTable.addRow (r);
BlueRowCollectionStaticStream staticStream = new BlueRowCollectionStaticStream (auxTable);
ProjectStream projStream = new ProjectStream (staticStream, colMapExpression);
return BlueDataUtility.extractRow (projStream.rows, 0);
}
} }
} }
@@ -8,13 +8,12 @@ namespace BCG {
internal class GroupByStream : MethodDrivenStream { internal class GroupByStream : MethodDrivenStream {
private class MyFuncGroupByEvaluator : IGroupByEvaluator { private class MyFuncGroupByEvaluator : IGroupByEvaluator {
private string[] _groupby_cols; private string[] _groupby_cols;
readonly Func<IDataPacket, IBlueRow> _groupby_func; private Func<DataPacket, IBlueRow> _groupby_func;
public MyFuncGroupByEvaluator(IEnumerable<string> groupby_cols, Func<IDataPacket, IBlueRow> groupby_func) { public MyFuncGroupByEvaluator(IEnumerable<string> groupby_cols, Func<DataPacket, IBlueRow> groupby_func) {
_groupby_cols = groupby_cols.ToArray(); _groupby_cols = groupby_cols.ToArray();
_groupby_func = groupby_func; _groupby_func = groupby_func;
} }
public IBlueRow evaluate(IDataPacket packet) => public IBlueRow evaluate(DataPacket packet) { return _groupby_func(packet); }
_groupby_func(packet);
public string[] groupByColumns { get { return _groupby_cols; } } public string[] groupByColumns { get { return _groupby_cols; } }
@@ -33,7 +32,7 @@ namespace BCG {
private IBlueTableSchema myOutputSchema; private IBlueTableSchema myOutputSchema;
private int myIdGenerator = 0; private int myIdGenerator = 0;
public GroupByStream(ViewStream stream, IEnumerable<string> groupby_cols, Func<IDataPacket, IBlueRow> groupby_func) public GroupByStream(ViewStream stream, IEnumerable<string> groupby_cols, Func<DataPacket, IBlueRow> groupby_func)
: this(stream, new MyFuncGroupByEvaluator(groupby_cols, groupby_func)) { } : this(stream, new MyFuncGroupByEvaluator(groupby_cols, groupby_func)) { }
public GroupByStream(ViewStream stream, IGroupByEvaluator groupByEvaluator) public GroupByStream(ViewStream stream, IGroupByEvaluator groupByEvaluator)
@@ -188,11 +187,11 @@ namespace BCG {
} }
} }
public static string getRepString(IDataPacket dp, string[] colNames) { public static string getRepString(DataPacket dp, string[] colNames) {
return BlueDataUtility.rowToString(getRepRow(dp), colNames); return BlueDataUtility.rowToString(getRepRow(dp), colNames);
} }
public static IBlueRow getRepRow(IDataPacket dp) { public static IBlueRow getRepRow(DataPacket dp) {
if (dp.newRows.Count > 0) if (dp.newRows.Count > 0)
return BlueDataUtility.extractRow(dp.newRows, 0); return BlueDataUtility.extractRow(dp.newRows, 0);
else if (dp.addedRows.Count > 0) else if (dp.addedRows.Count > 0)
@@ -1,3 +1,5 @@
using System;
namespace BCG namespace BCG
{ {
/// <summary> /// <summary>
@@ -12,7 +14,7 @@ namespace BCG
/// deletetion) and the added and deletedRows being the increments. If a group has /// deletetion) and the added and deletedRows being the increments. If a group has
/// to be totally removed then a null should be returned /// to be totally removed then a null should be returned
/// </summary> /// </summary>
IBlueRow? evaluate(IDataPacket packet); IBlueRow evaluate (DataPacket packet);
/// <summary> /// <summary>
/// Returns the columns (belonging to the original schema) on which this IGroupByEvaluator /// Returns the columns (belonging to the original schema) on which this IGroupByEvaluator
@@ -14,8 +14,9 @@ namespace BCG {
public MaxGroupByEvaluator(string colMapEpression, string outputCol, string[] groupByCols) public MaxGroupByEvaluator(string colMapEpression, string outputCol, string[] groupByCols)
: base(colMapEpression, outputCol, groupByCols) { } : base(colMapEpression, outputCol, groupByCols) { }
public override IBlueRow? evaluate(IDataPacket dp) { public override IBlueRow evaluate(DataPacket dp) {
myOutputTable ??= new GroupByOutputTable(dp.Schema); myOutputTable = myOutputTable == null ? new GroupByOutputTable(dp.schema) :
myOutputTable;
string hashString = BlueDataUtility.rowToString(GroupByStream.getRepRow(dp), myGroupByCols); string hashString = BlueDataUtility.rowToString(GroupByStream.getRepRow(dp), myGroupByCols);
IBlueRow currMaxRow = myOutputTable.getRow(hashString); IBlueRow currMaxRow = myOutputTable.getRow(hashString);
IBlueRow maxRow = BlueDataUtility.computeMaxRow(dp.deletedRows, myOutputColumn); IBlueRow maxRow = BlueDataUtility.computeMaxRow(dp.deletedRows, myOutputColumn);
@@ -1,3 +1,7 @@
using System;
using BCG.Utilities;
namespace BCG { namespace BCG {
public class MinGroupByEvaluator : MaxGroupByEvaluator { public class MinGroupByEvaluator : MaxGroupByEvaluator {
public MinGroupByEvaluator(string outputCol, string[] groupByCols) public MinGroupByEvaluator(string outputCol, string[] groupByCols)
@@ -6,8 +10,8 @@ namespace BCG {
public MinGroupByEvaluator(string colMapEpression, string outputCol, string[] groupByCols) : public MinGroupByEvaluator(string colMapEpression, string outputCol, string[] groupByCols) :
base(colMapEpression, outputCol, groupByCols) { } base(colMapEpression, outputCol, groupByCols) { }
public override IBlueRow? evaluate(IDataPacket dp) { public override IBlueRow evaluate(DataPacket dp) {
myOutputTable ??= new GroupByOutputTable(dp.Schema); myOutputTable = myOutputTable == null ? new GroupByOutputTable(dp.schema) : myOutputTable;
string stringRep = BlueDataUtility.rowToString(GroupByStream.getRepRow(dp), myGroupByCols); string stringRep = BlueDataUtility.rowToString(GroupByStream.getRepRow(dp), myGroupByCols);
IBlueRow currMinRow = myOutputTable.getRow(stringRep); IBlueRow currMinRow = myOutputTable.getRow(stringRep);
IBlueRow minRow = BlueDataUtility.computeMinRow(dp.deletedRows, myOutputColumn); IBlueRow minRow = BlueDataUtility.computeMinRow(dp.deletedRows, myOutputColumn);
@@ -1,10 +1,14 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BCG namespace BCG
{ {
public interface INonIncGroupByEvaluator public interface INonIncGroupByEvaluator
{ {
IBlueRowCollection? evaluate(IDictionary<int, List<IBlueRow>> grouped_rows); IBlueRowCollection evaluate(IDictionary<int, List<IBlueRow>> grouped_rows);
string[]? get_group_by_cols(); string[] get_group_by_cols();
} }
} }
@@ -1,51 +1,46 @@
using bts; using System;
using bts.SilverPine;
using Bts.DataStreamCore;
using Spark.Core.Diagnostics;
using Spark.Core.Disposables;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text.Json;
using bts;
using bts.SilverPine;
namespace BCG { namespace BCG {
//[DataStreamUserRespresentation("AggregateStream")] //[DataStreamUserRespresentation("AggregateStream")]
public class NonIncGroupByStream : ViewStream { public class NonIncGroupByStream : ViewStream {
private class DelNonIncGroupByEvaluator : INonIncGroupByEvaluator { private class DelNonIncGroupByEvaluator : INonIncGroupByEvaluator {
Func<string[]?> _groupby_cols_func; Func<string[]> _groupby_cols_func;
Func<List<IBlueRow>, List<IBlueRow>?> _evaluate_func; Func<List<IBlueRow>, List<IBlueRow>> _evaluate_func;
public DelNonIncGroupByEvaluator(Func<string[]?> groupby_cols_func, public DelNonIncGroupByEvaluator(Func<string[]> groupby_cols_func,
Func<List<IBlueRow>, List<IBlueRow>> evaluate_func) { Func<List<IBlueRow>, List<IBlueRow>> evaluate_func) {
_groupby_cols_func = groupby_cols_func; _groupby_cols_func = groupby_cols_func;
_evaluate_func = evaluate_func; _evaluate_func = evaluate_func;
} }
public IBlueRowCollection? evaluate(IDictionary<int, List<IBlueRow>> grouped_rows) { public IBlueRowCollection evaluate(IDictionary<int, List<IBlueRow>> grouped_rows) {
BlueTable? rv = null; BlueTable rv = null;
foreach (var kv in grouped_rows) { foreach (var kv in grouped_rows) {
List<IBlueRow> g_rows = kv.Value; List<IBlueRow> g_rows = kv.Value;
var out_rows = _evaluate_func(g_rows); List<IBlueRow> out_rows = _evaluate_func.Invoke(g_rows);
if (out_rows != null && out_rows.Count > 0) { if (out_rows != null && out_rows.Count > 0) {
rv = rv ?? new BlueTable(out_rows.ElementAt(0).schema); rv = rv ?? new BlueTable(out_rows.ElementAt(0).schema);
rv.addRows(out_rows);
} }
rv.addRows(out_rows);
} }
return rv; return rv;
} }
public string[]? get_group_by_cols() { public string[] get_group_by_cols() {
return _groupby_cols_func(); return _groupby_cols_func();
} }
} }
readonly ViewStream? _main_stream; private ViewStream _main_stream;
readonly INonIncGroupByEvaluator? _groupby_func; private INonIncGroupByEvaluator _groupby_func;
BlueRowHasher? _row_hasher; private BlueRowHasher _row_hasher;
readonly string[]? _groupby_cols; private string[] _groupby_cols;
private Stopwatch _timer = new(); private Stopwatch _timer = new();
private int _n_total_fires = 0, _n_expensive_fires = 0; private int _n_total_fires = 0, _n_expensive_fires = 0;
IDisposable? subscription;
public NonIncGroupByStream(ViewStream main_stream, INonIncGroupByEvaluator groupby_func) { public NonIncGroupByStream(ViewStream main_stream, INonIncGroupByEvaluator groupby_func) {
_main_stream = main_stream; _main_stream = main_stream;
@@ -54,7 +49,7 @@ namespace BCG {
_row_hasher = new BlueRowHasher(_groupby_cols == null ? 0 : _groupby_cols.Length); _row_hasher = new BlueRowHasher(_groupby_cols == null ? 0 : _groupby_cols.Length);
} }
public NonIncGroupByStream(ViewStream main_stream, Func<string[]?> groupby_cols_func, public NonIncGroupByStream(ViewStream main_stream, Func<string[]> groupby_cols_func,
Func<List<IBlueRow>, List<IBlueRow>> evaluate_func) Func<List<IBlueRow>, List<IBlueRow>> evaluate_func)
: this(main_stream, new DelNonIncGroupByEvaluator(groupby_cols_func, evaluate_func)) { } : this(main_stream, new DelNonIncGroupByEvaluator(groupby_cols_func, evaluate_func)) { }
@@ -63,7 +58,7 @@ namespace BCG {
public NonIncGroupByStream(ViewStream parent_str, string groupby_col, string standard_group_by_text, string optional_sort_col) { public NonIncGroupByStream(ViewStream parent_str, string groupby_col, string standard_group_by_text, string optional_sort_col) {
MultiRowOpHelper std_group_by = MultiRowOpHelper.parse(standard_group_by_text); MultiRowOpHelper std_group_by = MultiRowOpHelper.parse(standard_group_by_text);
Func<string[]?> groupby_cols_func = () => { Func<string[]> groupby_cols_func = () => {
return String.IsNullOrEmpty(groupby_col) ? null : new string[] { groupby_col }; return String.IsNullOrEmpty(groupby_col) ? null : new string[] { groupby_col };
}; };
Func<List<IBlueRow>, List<IBlueRow>> evaluate_func = (group_rows) => { Func<List<IBlueRow>, List<IBlueRow>> evaluate_func = (group_rows) => {
@@ -80,17 +75,12 @@ namespace BCG {
} }
protected override void myOnFirstSubscriber() { protected override void myOnFirstSubscriber() { _main_stream.onChange += _main_stream_onchange; }
ExceptionAssert.IsNull(subscription);
ExceptionAssert.NotNull(_main_stream).Subscribe(_main_stream_onchange);
}
protected override void myOnLastSubscriber() => protected override void myOnLastSubscriber() { _main_stream.onChange -= _main_stream_onchange; }
Disposable.Dispose(ref subscription);
private void _main_stream_onchange(object nv) { private void _main_stream_onchange(object nv) {
ExceptionAssert.NotNull(_groupby_func); DataPacket dp = nv as DataPacket;
var dp = (IDataPacket)nv;
///grouping together ///grouping together
_timer.Restart(); _timer.Restart();
IDictionary<int, List<IBlueRow>> grouped_rows = (_groupby_cols == null || _groupby_cols.Length == 0) ? IDictionary<int, List<IBlueRow>> grouped_rows = (_groupby_cols == null || _groupby_cols.Length == 0) ?
@@ -104,12 +94,8 @@ namespace BCG {
// Log.log(bts.Log.Level.Info, bts.log.Subsystem.gen, String.Format("Time to group {0} rows into {1} groups = {2}", dp.newRows.Count, grouped_rows.Count, _timer.lastIntervalTime)); // Log.log(bts.Log.Level.Info, bts.log.Subsystem.gen, String.Format("Time to group {0} rows into {1} groups = {2}", dp.newRows.Count, grouped_rows.Count, _timer.lastIntervalTime));
/// reducing /// reducing
_timer.Restart(); _timer.Restart();
var total_state = _groupby_func.evaluate(grouped_rows); IBlueRowCollection total_state = _groupby_func.evaluate(grouped_rows);
_timer.Stop(); _timer.Stop();
if (total_state is null) {
Log.Gen.warn("NonIncGroupByStream _groupby_func.evaluate returned null (ignoring last update).");
return;
}
var applyElapsedMs = _timer.ElapsedMilliseconds; var applyElapsedMs = _timer.ElapsedMilliseconds;
_n_total_fires++; _n_total_fires++;
if (applyElapsedMs >= 50) { if (applyElapsedMs >= 50) {
@@ -118,12 +104,8 @@ namespace BCG {
$"Time to evaluate {grouped_rows.Count} groups {_timer.ElapsedMilliseconds}ms, ratio {_n_expensive_fires}/{_n_total_fires}"); $"Time to evaluate {grouped_rows.Count} groups {_timer.ElapsedMilliseconds}ms, ratio {_n_expensive_fires}/{_n_total_fires}");
} }
// TODO, // TODO,
if (total_state != null) { if (total_state != null)
var deletedRows = myLastValue is null myFireEvent(new DataPacket(total_state, total_state, myLastValue == null ? new BlueTable(total_state.schema) : (myLastValue as DataPacket).newRows));
? new BlueTable(total_state.schema)
: ((IDataPacket)myLastValue).newRows;
myFireEvent(new DataPacket(total_state, total_state, deletedRows));
}
} }
} }
} }
@@ -1,6 +1,6 @@
using System; using System;
using BCG.Utilities;
using System.Collections; using System.Collections;
using System.Collections.Generic;
namespace BCG namespace BCG
{ {
@@ -11,10 +11,12 @@ namespace BCG
/// </summary> /// </summary>
public class RowDictionaryTable : IBlueRowCollection public class RowDictionaryTable : IBlueRowCollection
{ {
protected readonly Dictionary<string, BlueTable> myRowCollections = new(); protected IDictionary myRowCollections = new Hashtable ();
protected readonly BlueTable myLinearCollection; protected BlueTable myLinearCollection;
protected readonly string[] myCols; protected string[] myCols;
protected IBlueTableSchema mySchema; protected IBlueTableSchema mySchema;
protected RowDictionaryTable () {}
public RowDictionaryTable (IBlueRowCollection rows, params string[] cols) public RowDictionaryTable (IBlueRowCollection rows, params string[] cols)
: this (rows.schema, cols) : this (rows.schema, cols)
@@ -38,7 +40,7 @@ namespace BCG
public virtual void addRow (IBlueRow row) public virtual void addRow (IBlueRow row)
{ {
var rows = getMutableGroup(row); BlueTable rows = (BlueTable)getGroup (row);
if (rows == null) if (rows == null)
{ {
//i.e we dont have any group for this row => we need to create a new group //i.e we dont have any group for this row => we need to create a new group
@@ -51,7 +53,7 @@ namespace BCG
public virtual void removeRow (IBlueRow row) public virtual void removeRow (IBlueRow row)
{ {
var rowGroup = requireMutableGroup(row); BlueTable rowGroup = (BlueTable)getGroup (row);
// BlueEventLog.logAssert (rowGroup != null && rowGroup.Count > 0); // BlueEventLog.logAssert (rowGroup != null && rowGroup.Count > 0);
rowGroup.deleteRow (row); rowGroup.deleteRow (row);
myLinearCollection.deleteRow (row); myLinearCollection.deleteRow (row);
@@ -63,7 +65,7 @@ namespace BCG
public void removeGroup (IBlueRow representativeRow) public void removeGroup (IBlueRow representativeRow)
{ {
var rowGroup = requireGroup(representativeRow); IBlueRowCollection rowGroup = getGroup (representativeRow);
// BlueEventLog.logAssert (rowGroup != null && rowGroup.Count > 0); // BlueEventLog.logAssert (rowGroup != null && rowGroup.Count > 0);
foreach (IBlueRow row in rowGroup) foreach (IBlueRow row in rowGroup)
myLinearCollection.deleteRow (row); myLinearCollection.deleteRow (row);
@@ -83,31 +85,24 @@ namespace BCG
/// <returns></returns> /// <returns></returns>
//public IBlueRowCollection getGroup (IBlueRow row) {return getGroup ( //public IBlueRowCollection getGroup (IBlueRow row) {return getGroup (
public IBlueRowCollection? getGroup (IBlueRow r) => public IBlueRowCollection getGroup (IBlueRow r) {return getGroup (myRowToString (r));}
getGroup(myRowToString(r));
public ICollection getGroups () {return myRowCollections.Values;} public ICollection getGroups () {return myRowCollections.Values;}
public IBlueRowCollection? getGroup(string repString) => private bool myAreRowsEqual (IBlueRow r1, IBlueRow r2)
getMutableGroup(repString); {
bool retVal = true;
foreach (string col in myCols)
retVal &= r1[col].Equals(r2[col]);
return retVal;
}
BlueTable? getMutableGroup(IBlueRow row) => public IBlueRowCollection getGroup (string repString)
getMutableGroup(myRowToString(row)); {
IBlueRowCollection retVal = myRowCollections[repString] != null ?
BlueTable? getMutableGroup(string group) => (IBlueRowCollection) myRowCollections[repString] : null;
myRowCollections.GetValueOrDefault(group); return retVal;
}
IBlueRowCollection requireGroup(IBlueRow row) =>
requireGroup(myRowToString(row));
IBlueRowCollection requireGroup(string group) =>
getGroup(group) ?? throw new ArgumentException("No table for group", nameof(group));
BlueTable requireMutableGroup(IBlueRow row) =>
requireMutableGroup(myRowToString(row));
BlueTable requireMutableGroup(string group) =>
getMutableGroup(group) ?? throw new ArgumentException("No table for group", nameof(group));
private string myRowToString (IBlueRow r) {return BlueDataUtility.rowToString (r, myCols);} private string myRowToString (IBlueRow r) {return BlueDataUtility.rowToString (r, myCols);}
@@ -1,3 +1,5 @@
using System;
namespace BCG { namespace BCG {
/// <summary> /// <summary>
/// Computes the sum for a given column /// Computes the sum for a given column
@@ -8,8 +10,8 @@ namespace BCG {
public SumGroupByEvaluator(string colMapEpression, string outputCol, string[] groupByCols) public SumGroupByEvaluator(string colMapEpression, string outputCol, string[] groupByCols)
: base(colMapEpression, outputCol, groupByCols) { } : base(colMapEpression, outputCol, groupByCols) { }
public override IBlueRow evaluate(IDataPacket dp) { public override IBlueRow evaluate(DataPacket dp) {
myOutputTable ??= new GroupByOutputTable(dp.Schema); myOutputTable = myOutputTable == null ? new GroupByOutputTable(dp.schema) : myOutputTable;
IBlueRow sumRow = BlueDataUtility.computeSum(dp.newRows, myOutputColumn); IBlueRow sumRow = BlueDataUtility.computeSum(dp.newRows, myOutputColumn);
return sumRow; return sumRow;
@@ -31,7 +33,7 @@ namespace BCG {
#region IGroupByEvaluator Members #region IGroupByEvaluator Members
public IBlueRow evaluate(IDataPacket packet) => BlueDataUtility.computeSum(packet.newRows, myOutputCols); public IBlueRow evaluate(DataPacket packet) { return BlueDataUtility.computeSum(packet.newRows, myOutputCols); }
public string[] groupByColumns { get { return myGroupByCols; } } public string[] groupByColumns { get { return myGroupByCols; } }
@@ -49,8 +51,9 @@ namespace BCG {
public SumGroupByEvaluator(string colMapEpression, string outputCol, string[] groupByCols) public SumGroupByEvaluator(string colMapEpression, string outputCol, string[] groupByCols)
: base(colMapEpression, outputCol, groupByCols) { } : base(colMapEpression, outputCol, groupByCols) { }
public override IBlueRow evaluate(IDataPacket dp) { public override IBlueRow evaluate(DataPacket dp) {
myOutputTable ??= new GroupByOutputTable(dp.Schema); myOutputTable = myOutputTable == null ? new GroupByOutputTable(dp.schema) : myOutputTable;
IBlueRow sumRow = BlueDataUtility.computeSum<T>(dp.newRows, myOutputColumn); IBlueRow sumRow = BlueDataUtility.computeSum<T>(dp.newRows, myOutputColumn);
return sumRow; return sumRow;
} }
@@ -65,7 +68,7 @@ namespace BCG {
#region IGroupByEvaluator Members #region IGroupByEvaluator Members
public IBlueRow evaluate(IDataPacket packet) => BlueDataUtility.computeSum<T>(packet.newRows, myOutputCols); public IBlueRow evaluate(DataPacket packet) { return BlueDataUtility.computeSum<T>(packet.newRows, myOutputCols); }
public string[] groupByColumns { get { return myGroupByCols; } } public string[] groupByColumns { get { return myGroupByCols; } }
@@ -1,3 +1,5 @@
using System;
namespace BCG namespace BCG
{ {
[DataStreamUserRespresentation (false)] [DataStreamUserRespresentation (false)]
@@ -15,7 +17,6 @@ namespace BCG
protected override void myInitFiredPacket () protected override void myInitFiredPacket ()
{ {
requireSchema();
myLastFiredPacket = new DataPacket (); myLastFiredPacket = new DataPacket ();
myLastFiredPacket.newRows = new JoinForeignTable (mySchema); myLastFiredPacket.newRows = new JoinForeignTable (mySchema);
myLastFiredPacket.addedRows = new BlueTable (mySchema); myLastFiredPacket.addedRows = new BlueTable (mySchema);
@@ -24,10 +25,6 @@ namespace BCG
public override void onTableClear (bool isLeft) public override void onTableClear (bool isLeft)
{ {
if (myLastFiredPacket is null) {
return;
}
requireSchema();
//incase of natural join, left or right wont matter, the end result zeroes out //incase of natural join, left or right wont matter, the end result zeroes out
myLastFiredPacket.deletedRows = myLastFiredPacket.newRows; myLastFiredPacket.deletedRows = myLastFiredPacket.newRows;
myLastFiredPacket.newRows = new JoinForeignTable (mySchema); myLastFiredPacket.newRows = new JoinForeignTable (mySchema);
@@ -1,7 +1,5 @@
using Spark.Core.Diagnostics;
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Collections;
namespace BCG namespace BCG
{ {
@@ -15,10 +13,12 @@ namespace BCG
protected JoinOperand myLeftOperand, myRightOperand; protected JoinOperand myLeftOperand, myRightOperand;
protected int myLeftJoinColOrdinal, myRightJoinColOrdinal; protected int myLeftJoinColOrdinal, myRightJoinColOrdinal;
protected ViewStream myLeftStream, myRightStream; protected ViewStream myLeftStream, myRightStream;
protected JoinTableSchema? mySchema; protected JoinTableSchema mySchema;
protected DataPacket? myLastFiredPacket; protected DataPacket myLastFiredPacket;
protected bool myOnceFired = false; protected bool myOnceFired = false;
public IBlueTableSchema schema {get{return mySchema;}}
public InternalJoinStream (ViewStream vsLeft, string jcLeft, ViewStream vsRight, string jcRight) public InternalJoinStream (ViewStream vsLeft, string jcLeft, ViewStream vsRight, string jcRight)
{ {
myLeftStream = vsLeft; myLeftStream = vsLeft;
@@ -27,9 +27,6 @@ namespace BCG
myRightOperand = new JoinOperand (jcRight, false); myRightOperand = new JoinOperand (jcRight, false);
} }
public IBlueTableSchema schema =>
requireSchema();
protected override void myOnFirstSubscriber() protected override void myOnFirstSubscriber()
{ {
myLeftOperand.master = this; myLeftOperand.master = this;
@@ -65,32 +62,29 @@ namespace BCG
{ {
myLeftJoinColOrdinal = myLeftOperand.joinColOridinal; myLeftJoinColOrdinal = myLeftOperand.joinColOridinal;
myRightJoinColOrdinal = myRightOperand.joinColOridinal; myRightJoinColOrdinal = myRightOperand.joinColOridinal;
myLeftOperand.RequireInitialized();
myRightOperand.RequireInitialized();
mySchema = new JoinTableSchema (myLeftOperand.operandSchema, myLeftOperand.joinCol, mySchema = new JoinTableSchema (myLeftOperand.operandSchema, myLeftOperand.joinCol,
myRightOperand.operandSchema, myRightOperand.joinCol); myRightOperand.operandSchema, myRightOperand.joinCol);
myInitFiredPacket (); myInitFiredPacket ();
} }
} }
[MemberNotNull(nameof(mySchema), nameof(myLastFiredPacket))]
protected virtual void myInitFiredPacket () protected virtual void myInitFiredPacket ()
{ {
var schema = requireSchema();
myLastFiredPacket = new DataPacket (); myLastFiredPacket = new DataPacket ();
myLastFiredPacket.newRows = new JoinTable (schema); myLastFiredPacket.newRows = new JoinTable (mySchema);
myLastFiredPacket.addedRows = new BlueTable (schema); myLastFiredPacket.addedRows = new BlueTable (mySchema);
myLastFiredPacket.deletedRows = new BlueTable (schema); myLastFiredPacket.deletedRows = new BlueTable (mySchema);
} }
public IBlueTableSchema? getSchema (bool isLeft) => public IBlueTableSchema getSchema (bool isLeft)
isLeft ? myLeftOperand.operandSchema : myRightOperand.operandSchema; {
IBlueTableSchema retVal;
retVal = isLeft ? myLeftOperand.operandSchema : myRightOperand.operandSchema;
return retVal;
}
public void endSession () public void endSession ()
{ {
if (myLastFiredPacket is null) {
return;
}
if (!myOnceFired) if (!myOnceFired)
{ {
myOnceFired = true; myOnceFired = true;
@@ -103,17 +97,13 @@ namespace BCG
protected virtual void myInit () protected virtual void myInit ()
{ {
myLeftOperand.Reset (); myLeftOperand.init ();
myRightOperand.Reset (); myRightOperand.init ();
myLastFiredPacket = null; myLastFiredPacket = null;
} }
public virtual void onTableClear (bool isLeft) public virtual void onTableClear (bool isLeft)
{ {
if (myLastFiredPacket is null) {
return;
}
requireSchema();
//incase of natural join, left or right wont matter, the end result zeroes out //incase of natural join, left or right wont matter, the end result zeroes out
myLastFiredPacket.deletedRows = myLastFiredPacket.newRows; myLastFiredPacket.deletedRows = myLastFiredPacket.newRows;
myLastFiredPacket.newRows = new JoinTable (mySchema); myLastFiredPacket.newRows = new JoinTable (mySchema);
@@ -122,19 +112,15 @@ namespace BCG
public virtual void deleteRows (IBlueRowCollection rows, bool isLeft) public virtual void deleteRows (IBlueRowCollection rows, bool isLeft)
{ {
var last = myLastFiredPacket;
if (last is null) {
return;
}
JoinOperand thisOp, otherOp; JoinOperand thisOp, otherOp;
int joinColOrdinal; int joinColOrdinal;
myAssignAccordingly (out thisOp, out otherOp, out joinColOrdinal, isLeft); myAssignAccordingly (out thisOp, out otherOp, out joinColOrdinal, isLeft);
foreach (IBlueRow row in rows) foreach (IBlueRow row in rows)
{ {
thisOp.deleteRow (row); thisOp.deleteRow (row);
if (otherOp.getMatchingRows(getJoinKey(row, joinColOrdinal)).Count == 0) if (otherOp.getMatchingRows (row[joinColOrdinal]).Count == 0)
continue; //row does not participate in join continue; //row does not participate in join
((JoinTable)last.newRows).deleteRow(isLeft, row, last); ((JoinTable)(myLastFiredPacket.newRows)).deleteRow (isLeft, row, myLastFiredPacket);
} }
} }
@@ -149,12 +135,10 @@ namespace BCG
otherOp = myLeftOperand; otherOp = myLeftOperand;
joinColOrdinal = myRightJoinColOrdinal; joinColOrdinal = myRightJoinColOrdinal;
} }
var schema = requireSchema();
myLastFiredPacket ??= new DataPacket(new BlueTable(schema), new BlueTable(schema), new BlueTable(schema));
foreach (IBlueRow row in rows) foreach (IBlueRow row in rows)
{ {
thisOp.addRow (row); thisOp.addRow (row);
RowList matchedNodes = otherOp.getMatchingRows(getJoinKey(row, joinColOrdinal)); RowList matchedNodes = otherOp.getMatchingRows (row[joinColOrdinal]);
if (matchedNodes.Count == 0) if (matchedNodes.Count == 0)
continue; //this row did not participate in the join continue; //this row did not participate in the join
if (isLeft) if (isLeft)
@@ -162,22 +146,10 @@ namespace BCG
((JoinTable)myLastFiredPacket.newRows).addRow (row, matchedNode.row, myLastFiredPacket); ((JoinTable)myLastFiredPacket.newRows).addRow (row, matchedNode.row, myLastFiredPacket);
else else
foreach (RowNode matchedNode in matchedNodes) foreach (RowNode matchedNode in matchedNodes)
((JoinTable)myLastFiredPacket.newRows).addRow(ExceptionAssert.NotNull(matchedNode.row), row, myLastFiredPacket); ((JoinTable)myLastFiredPacket.newRows).addRow (matchedNode.row, row, myLastFiredPacket);
} }
} }
[MemberNotNull(nameof(mySchema))]
protected JoinTableSchema requireSchema() =>
ExceptionAssert.NotNull(mySchema);
[MemberNotNull(nameof(myLastFiredPacket))]
protected DataPacket requireLastFiredPacket() {
if (myLastFiredPacket is null) {
myInitFiredPacket();
}
return myLastFiredPacket;
}
private void myAssignAccordingly (out JoinOperand thisOp, out JoinOperand otherOp, out int joinColOrdinal, bool isLeft) private void myAssignAccordingly (out JoinOperand thisOp, out JoinOperand otherOp, out int joinColOrdinal, bool isLeft)
{ {
if (isLeft) if (isLeft)
@@ -194,9 +166,6 @@ namespace BCG
} }
} }
object getJoinKey(IBlueRow row, int joinColOrdinal) =>
row[joinColOrdinal] ?? throw new ArgumentException("Row has null join key", nameof(row));
/**************************************TEST METHOD(S)*********************************************/ /**************************************TEST METHOD(S)*********************************************/
/// <summary> /// <summary>
/// Used for testing purposes only. This enables the test to work without a DataSource (PubServer, /// Used for testing purposes only. This enables the test to work without a DataSource (PubServer,
@@ -204,7 +173,8 @@ namespace BCG
/// </summary> /// </summary>
/// <param name="leftPacket"></param> /// <param name="leftPacket"></param>
/// <param name="rightPacket"></param> /// <param name="rightPacket"></param>
public void test(IDataPacket dp, bool isLeft) { public void test (DataPacket dp, bool isLeft)
{
JoinOperand jo = isLeft ? myLeftOperand : myRightOperand; JoinOperand jo = isLeft ? myLeftOperand : myRightOperand;
jo.changeHandler (dp); jo.changeHandler (dp);
} }
@@ -1,6 +1,5 @@
using Spark.Core.Diagnostics; using System;
using System.Collections;
using System.Collections.Generic;
namespace BCG namespace BCG
{ {
@@ -9,7 +8,7 @@ namespace BCG
/// </summary> /// </summary>
internal class JoinDeletionIndex internal class JoinDeletionIndex
{ {
Dictionary<object, RowList> myIndex = new(); IDictionary myIndex = new Hashtable ();
private string myOpIdName ; private string myOpIdName ;
private bool myIsLeft; private bool myIsLeft;
@@ -29,8 +28,10 @@ namespace BCG
/// <param name="row">JoinRow to add</param> /// <param name="row">JoinRow to add</param>
public void add (JoinRow row) public void add (JoinRow row)
{ {
object o = ExceptionAssert.NotNull(row[myOpIdName]); object o = row[myOpIdName];
RowNode nodeAdded = myIndex.GetOrAdd(o, _ => new()).add(row); if (myIndex[o] == null)
myIndex[o] = new RowList ();
RowNode nodeAdded = ((RowList)myIndex[o]).add (row);
if (myIsLeft) if (myIsLeft)
row.leftNode = nodeAdded; row.leftNode = nodeAdded;
else else
@@ -42,10 +43,7 @@ namespace BCG
/// To remove a node, if node does not exist exception is thrown /// To remove a node, if node does not exist exception is thrown
/// </summary> /// </summary>
/// <param name="node"></param> /// <param name="node"></param>
public void remove (RowNode node) { public void remove (RowNode node) {((RowList)myIndex[node.row[myOpIdName]]).remove (node);}
var nodeId = ExceptionAssert.NotNull(node.row?[myOpIdName]);
myIndex[nodeId].remove(node);
}
public RowList getMatchingRows (object key) { public RowList getMatchingRows (object key) {
RowList retVal = (RowList)myIndex[key]; RowList retVal = (RowList)myIndex[key];
@@ -1,6 +1,7 @@
using bts; using System;
using BCG.Utilities;
using Bts.DataStreamCore; using bts;
namespace BCG namespace BCG
{ {
@@ -8,11 +9,11 @@ namespace BCG
{ {
public JoinForeignTable (JoinTableSchema schema) : base (schema) {} public JoinForeignTable (JoinTableSchema schema) : base (schema) {}
public override void addRow(IBlueRow leftRow, IBlueRow? rightRow, IDataPacket dp) { public override void addRow (IBlueRow leftRow, IBlueRow rightRow, DataPacket dp)
var newRow = new JoinRow(leftRow, rightRow, mySchema); {
int leftId = leftRow.Id(); JoinRow newRow = new JoinRow (leftRow, rightRow, mySchema);
Log.assert(myIdIndex[leftId] == null); Log.assert(myIdIndex[leftRow["id"]] == null);
myIdIndex[leftId] = newRow; myIdIndex[leftRow["id"]] = newRow;
((BlueTable)(dp.addedRows)).addRow (newRow); ((BlueTable)(dp.addedRows)).addRow (newRow);
myLeftIndex.add (newRow); myLeftIndex.add (newRow);
myRightIndex.add (newRow); myRightIndex.add (newRow);
@@ -1,12 +1,11 @@
using System;
using System.Collections;
using BCG.Utilities;
using bts; using bts;
using Bts.ColumnMapExpressions; using Bts.ColumnMapExpressions;
using Spark.Core.Diagnostics;
using System;
using System.Collections;
namespace BCG namespace BCG
{ {
/// <summary> /// <summary>
@@ -38,8 +37,7 @@ namespace BCG
private JoinTableSchema myJoinSchema; private JoinTableSchema myJoinSchema;
private IBlueTableSchema myLeftSchema, myRightSchema; private IBlueTableSchema myLeftSchema, myRightSchema;
private string myLeftColExpression, myRightColExpression; private string myLeftColExpression, myRightColExpression;
string[] myUserRules; private string[] myUserRules, myResolvedNames;
string[]? myResolvedNames;
private IDictionary myFinalMap = new Hashtable (); private IDictionary myFinalMap = new Hashtable ();
@@ -89,18 +87,16 @@ namespace BCG
/// </summary> /// </summary>
private void myFormUserRules () private void myFormUserRules ()
{ {
var leftExp = ColumnMapExpression.Parse(myLeftColExpression) ?? throw new InvalidOperationException("Failed to parse left column expression");
var rightExp = ColumnMapExpression.Parse(myRightColExpression) ?? throw new InvalidOperationException("Failed to parse right column expression");
if (DataStreamLoadFileConfig.instance.useStaticParser) if (DataStreamLoadFileConfig.instance.useStaticParser)
{ {
myFormUserRules(true, leftExp); myFormUserRules(true, ColumnMapExpression.Parse(myLeftColExpression));
myFormUserRules(false, rightExp); myFormUserRules(false, ColumnMapExpression.Parse(myRightColExpression));
} }
else else
{ {
// TODO (maybe): Actually use non-static parser (unclear what advantages it will have) // TODO (maybe): Actually use non-static parser (unclear what advantages it will have)
myFormUserRules(true, leftExp); myFormUserRules(true, ColumnMapExpression.Parse(myLeftColExpression));
myFormUserRules(false, rightExp); myFormUserRules(false, ColumnMapExpression.Parse(myRightColExpression));
} }
} }
@@ -119,7 +115,13 @@ namespace BCG
OriginalNameInfo oni = myOriginalColInfo[i]; OriginalNameInfo oni = myOriginalColInfo[i];
if (oni.isLeft == isLeft) if (oni.isLeft == isLeft)
{ {
myUserRules[i] = userMap[oni.colName] as string ?? oni.colName; if (userMap[oni.colName] != null)
{
if ((string)userMap[oni.colName] != oni.colName)
myUserRules[i] = (string)userMap[oni.colName];
else
myUserRules[i] = oni.colName;
}
} }
} }
else else
@@ -129,13 +131,10 @@ namespace BCG
OriginalNameInfo oni = myOriginalColInfo[i]; OriginalNameInfo oni = myOriginalColInfo[i];
if (oni.isLeft == isLeft) if (oni.isLeft == isLeft)
{ {
var colName = userMap[oni.colName] as string; if (userMap[oni.colName] == null)
// myUserRules[i] = userMap[oni.colName] as string
if (colName is null) {
myUserRules[i] = oni.colName; myUserRules[i] = oni.colName;
} else if (colName != oni.colName) { else if ((string)userMap[oni.colName] != oni.colName)
myUserRules[i] = colName; myUserRules[i] = (string)userMap[oni.colName];
}
} }
} }
} }
@@ -166,12 +165,26 @@ namespace BCG
private void myFormFinalMap () private void myFormFinalMap ()
{ {
ExceptionAssert.NotNull(myResolvedNames);
foreach (string resolvedName in myResolvedNames) foreach (string resolvedName in myResolvedNames)
if (resolvedName != null) if (resolvedName != null)
myFinalMap [resolvedName] = myJoinNames[Array.IndexOf (myResolvedNames, resolvedName)]; myFinalMap [resolvedName] = myJoinNames[Array.IndexOf (myResolvedNames, resolvedName)];
} }
/// <summary>
/// Utility method to invert a hashtable
/// </summary>
/// <param name="arg"></param>
/// <returns></returns>
private IDictionary reciprocateDictionary (IDictionary arg)
{
IDictionary retVal = new Hashtable ();
foreach (DictionaryEntry de in arg)
retVal[de.Value] = de.Key;
return retVal;
}
/// <summary> /// <summary>
/// Utility method to find all occurances of an obkect in an IList /// Utility method to find all occurances of an obkect in an IList
/// </summary> /// </summary>
@@ -181,11 +194,9 @@ namespace BCG
private ArrayList myFindAllInCollection (IList list, object obj) private ArrayList myFindAllInCollection (IList list, object obj)
{ {
ArrayList retVal = new ArrayList (); ArrayList retVal = new ArrayList ();
for (int i = 0; i < list.Count; i++) { for (int i = 0; i < list.Count; i++)
if (Equals(list[i], obj)) { if (list[i] != null && list[i].Equals (obj))
retVal.Add (i); retVal.Add (i);
}
}
return retVal; return retVal;
} }
@@ -1,7 +1,6 @@
using Spark.Core.Diagnostics;
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Collections;
using BCG.Utilities;
namespace BCG namespace BCG
{ {
@@ -12,46 +11,34 @@ namespace BCG
public class JoinOperand public class JoinOperand
{ {
private string myJoinCol; private string myJoinCol;
IDataPacket? myLastArrivedPacket; private DataPacket myLastArrivedPacket;
JoinOperand? myOtherOperand; private JoinOperand myOtherOperand;
private bool myIsLeft; private bool myIsLeft;
JoinOperandRowIndex? myRowIndex; private JoinOperandRowIndex myRowIndex;
InternalJoinStream? myMaster; private InternalJoinStream myMaster;
private IBlueTableSchema myOpSchema;
public JoinOperand (string joinCol, bool isLeft) public JoinOperand (string joinCol, bool isLeft)
{ {
myJoinCol = joinCol; myJoinCol = joinCol;
myIsLeft = isLeft; myIsLeft = isLeft;
} }
[MemberNotNullWhen(true, nameof(myMaster), nameof(myLastArrivedPacket), nameof(operandSchema), nameof(myOtherOperand), nameof(myRowIndex))]
bool isInitialized {
get {
if (myLastArrivedPacket is null) {
return false;
}
ExceptionAssert.NotNull(myMaster, myLastArrivedPacket, operandSchema, myOtherOperand, myRowIndex);
return true;
}
}
internal void changeHandler (object o) internal void changeHandler (object o)
{ {
var dp = (IDataPacket)o; DataPacket temp = (DataPacket)o;
if (isInitialized) { if (myLastArrivedPacket != null)
mySubsequentChangeHandler (dp); mySubsequentChangeHandler ((DataPacket)o);
} else { else
myFirstChangeHandler(dp); myFirstChangeHandler ((DataPacket)o);
}
} }
[MemberNotNull(nameof(myLastArrivedPacket), nameof(operandSchema), nameof(myOtherOperand), nameof(myRowIndex))] private void myFirstChangeHandler (DataPacket arrivedDp)
bool myFirstChangeHandler(IDataPacket arrivedDp) { {
ExceptionAssert.NotNull(myMaster);
myLastArrivedPacket = arrivedDp; myLastArrivedPacket = arrivedDp;
operandSchema = myLastArrivedPacket.newRows.schema; myOpSchema = myLastArrivedPacket.newRows.schema;
myOtherOperand = myMaster.getOtherOperand (this); myOtherOperand = myMaster.getOtherOperand (this);
myRowIndex = new JoinOperandRowIndex (operandSchema[myJoinCol].colNo, operandSchema["id"].colNo); myRowIndex = new JoinOperandRowIndex (myOpSchema[myJoinCol].colNo, myOpSchema["id"].colNo);
if (myOtherOperand.hasReceivedData) if (myOtherOperand.hasReceivedData)
{ {
//the other operand has already received data, so the join would //the other operand has already received data, so the join would
@@ -62,16 +49,14 @@ namespace BCG
myMaster.addRows (myLastArrivedPacket.newRows, myIsLeft); myMaster.addRows (myLastArrivedPacket.newRows, myIsLeft);
myMaster.endSession (); myMaster.endSession ();
} }
else { else
myRowIndex = new JoinOperandRowIndex (myLastArrivedPacket.newRows, myRowIndex = new JoinOperandRowIndex (myLastArrivedPacket.newRows,
operandSchema[myJoinCol].colNo, myOpSchema[myJoinCol].colNo,
operandSchema["id"].colNo); myOpSchema["id"].colNo);
}
return true;
} }
void mySubsequentChangeHandler (IDataPacket arrivedDp) { private void mySubsequentChangeHandler (DataPacket arrivedDp)
RequireInitialized(); {
myLastArrivedPacket = arrivedDp; myLastArrivedPacket = arrivedDp;
if (!myOtherOperand.hasReceivedData) if (!myOtherOperand.hasReceivedData)
{ {
@@ -100,46 +85,29 @@ namespace BCG
myMaster.endSession (); myMaster.endSession ();
} }
internal void addRow (IBlueRow row) => internal void addRow (IBlueRow row) {myRowIndex.add (row);}
ExceptionAssert.NotNull(myRowIndex).add(row);
internal void deleteRow (IBlueRow row) { internal void deleteRow (IBlueRow row) {myRowIndex.remove (row);}
RequireInitialized();
myRowIndex.remove (row);
}
internal IBlueTableSchema? operandSchema { get; private set; } internal IBlueTableSchema operandSchema {get{return myOpSchema;}}
internal InternalJoinStream master {set{myMaster = value;}} internal InternalJoinStream master {set{myMaster = value;}}
internal string joinCol {get{return myJoinCol;}} internal string joinCol {get{return myJoinCol;}}
internal int joinColOridinal { internal int joinColOridinal {get{return myOpSchema[myJoinCol].colNo;}}
get {
RequireInitialized();
return operandSchema[myJoinCol].colNo;
}
}
internal RowList getMatchingRows (object key) { internal RowList getMatchingRows (object key) {return (RowList) myRowIndex.getMatchingRows (key);}
RequireInitialized();
return myRowIndex.getMatchingRows(key);
}
internal bool hasReceivedData {get{return myLastArrivedPacket != null;}} internal bool hasReceivedData {get{return myLastArrivedPacket != null;}}
internal void Reset() { internal void init ()
{
///should be brought back to the the state before the first callback ///should be brought back to the the state before the first callback
///(ie the state after construction) ///(ie the state after construction)
myRowIndex = null; myRowIndex = null;
myLastArrivedPacket = null; myLastArrivedPacket = null;
} }
[MemberNotNull(nameof(myMaster), nameof(myLastArrivedPacket), nameof(operandSchema), nameof(myOtherOperand), nameof(myRowIndex))]
internal void RequireInitialized() {
if (!isInitialized) {
throw new InvalidOperationException("Internal state not properly initialized");
}
}
} }
} }
@@ -1,6 +1,6 @@
using Spark.Core.Diagnostics; using System;
using System.Collections;
using System.Collections.Generic; using BCG.Utilities;
namespace BCG namespace BCG
{ {
@@ -11,10 +11,8 @@ namespace BCG
/// </summary> /// </summary>
internal class JoinOperandRowIndex internal class JoinOperandRowIndex
{ {
readonly Dictionary<object, RowList> myJoinColDict = new(); private IDictionary myJoinColDict = new Hashtable (), myIdDict = new Hashtable ();
readonly Dictionary<int, RowNode> myIdDict = new(); private int myJoinColOrdinal, myIdColOrdinal;
readonly int myJoinColOrdinal;
readonly int myIdColOrdinal;
/// <summary> /// <summary>
/// ///
@@ -36,14 +34,19 @@ namespace BCG
public void add (IBlueRow row) public void add (IBlueRow row)
{ {
myIdDict[getId(row)] = myJoinColDict.GetOrAdd(getJoinKey(row), _ => new()).add(row); RowList list;
if (myJoinColDict[row[myJoinColOrdinal]] == null)
myJoinColDict[row[myJoinColOrdinal]] = list = new RowList ();
else
list = (RowList)myJoinColDict[row[myJoinColOrdinal]];
myIdDict[row[myIdColOrdinal]] = list.add (row);
} }
public void remove (IBlueRow row) public void remove (IBlueRow row)
{ {
var id = getId(row); RowNode node = (RowNode)myIdDict[row[myIdColOrdinal]];
myJoinColDict[getJoinKey(row)].remove(myIdDict[id]); ((RowList)myJoinColDict[row[myJoinColOrdinal]]).remove (node);
myIdDict.Remove(id); myIdDict.Remove (row[myIdColOrdinal]);
} }
public RowList getMatchingRows (object key) public RowList getMatchingRows (object key)
@@ -59,11 +62,5 @@ namespace BCG
myJoinColDict.Clear (); myJoinColDict.Clear ();
myIdDict.Clear (); myIdDict.Clear ();
} }
object getJoinKey(IBlueRow row) =>
ExceptionAssert.NotNull(row[myJoinColOrdinal]);
int getId(IBlueRow row) =>
(int)row[myIdColOrdinal]!;
} }
} }
@@ -1,21 +1,17 @@
using bts;
using Bts.DataStreamCore;
using System; using System;
using BCG.Utilities;
using System.Collections; using System.Collections;
using bts;
namespace BCG namespace BCG
{ {
internal class JoinRow : IBlueRow internal class JoinRow : IBlueRow
{ {
RowNode? myLeftNode; private RowNode myLeftNode, myRightNode;
RowNode? myRightNode; protected IBlueRow myLeftRow, myRightRow;
protected IBlueRow myLeftRow;
protected IBlueRow? myRightRow;
protected int myId; protected int myId;
protected JoinTableSchema mySchema; protected JoinTableSchema mySchema;
private object?[] myValues; private object[] myValues;
#region Constructor(s) #region Constructor(s)
@@ -25,8 +21,8 @@ namespace BCG
/// <param name="leftRow">left row of the join</param> /// <param name="leftRow">left row of the join</param>
/// <param name="rightRow">right row of the join</param> /// <param name="rightRow">right row of the join</param>
/// <param name="schema">schema of the joined row</param> /// <param name="schema">schema of the joined row</param>
public JoinRow (IBlueRow leftRow, IBlueRow? rightRow, JoinTableSchema schema) public JoinRow (IBlueRow leftRow, IBlueRow rightRow, JoinTableSchema schema)
: this(leftRow.Id(), leftRow, rightRow, schema) { } : this ((int)leftRow["id"], leftRow, rightRow, schema) {}
/// <summary> /// <summary>
/// Constructs a row assigning it the ID provioded as the first argument /// Constructs a row assigning it the ID provioded as the first argument
@@ -35,7 +31,8 @@ namespace BCG
/// <param name="leftRow">left row of the join</param> /// <param name="leftRow">left row of the join</param>
/// <param name="rightRow">right row of the join</param> /// <param name="rightRow">right row of the join</param>
/// <param name="schema">schema of the joined row</param> /// <param name="schema">schema of the joined row</param>
public JoinRow (int id, IBlueRow leftRow, IBlueRow? rightRow, JoinTableSchema schema) { public JoinRow (int id, IBlueRow leftRow, IBlueRow rightRow, JoinTableSchema schema)
{
myId = id; myId = id;
myLeftRow = leftRow; myLeftRow = leftRow;
myRightRow = rightRow; myRightRow = rightRow;
@@ -51,13 +48,13 @@ namespace BCG
public bool isPartialJoin{get{return myRightRow == null;}} public bool isPartialJoin{get{return myRightRow == null;}}
public RowNode? leftNode public RowNode leftNode
{ {
get{return myLeftNode;} get{return myLeftNode;}
set{myLeftNode = value;} set{myLeftNode = value;}
} }
public RowNode? rightNode public RowNode rightNode
{ {
get{return myRightNode;} get{return myRightNode;}
set{myRightNode = value;} set{myRightNode = value;}
@@ -88,7 +85,7 @@ namespace BCG
/// The key can either be the string corrsponding to the column name or /// The key can either be the string corrsponding to the column name or
/// the order of the column /// the order of the column
/// </summary> /// </summary>
public virtual object? this[object key] public virtual object this [object key]
{ {
get get
{ {
@@ -99,7 +96,7 @@ namespace BCG
set {throw new NotSupportedException ("The IBlueRow is read only");} set {throw new NotSupportedException ("The IBlueRow is read only");}
} }
public object? this[int index] public object this [int index]
{ {
get get
{ {
@@ -122,8 +119,7 @@ namespace BCG
} }
} }
public object? this[string colName] => public object this [string colName] {get{return this[mySchema[colName].colNo];}}
this[mySchema[colName].colNo];
public ICollection Keys{get{return mySchema.columnNames;}} public ICollection Keys{get{return mySchema.columnNames;}}
@@ -137,8 +133,7 @@ namespace BCG
} }
} }
public void Add (object key, object? value) => public void Add (object key, object value) {throw new NotSupportedException ("The IBlueRow is readonly");}
throw new NotSupportedException ("The IBlueRow is readonly");
public void Clear () {throw new NotSupportedException ("The IBlueRow is readonly");} public void Clear () {throw new NotSupportedException ("The IBlueRow is readonly");}
@@ -1,26 +1,20 @@
using bts;
using Bts.DataStreamCore;
using Spark.Core.Diagnostics;
using Spark.Core.Disposables;
using System; using System;
using System.Data;
using System.Collections; using System.Collections;
using System.Text.RegularExpressions;
using BCG.Utilities;
using BCG.Utilities.General;
using bts;
namespace BCG namespace BCG
{ {
public class JoinStream : ViewStream public class JoinStream : ViewStream
{ {
protected readonly InternalJoinStream? myIjs; protected InternalJoinStream? myIjs;
protected readonly ColumnMap? myLeftCm;
protected readonly ColumnMap? myRightCm;
protected readonly bool myIsProject = true;
protected ProjectStream? myPs; protected ProjectStream? myPs;
protected ColumnMap? myLeftCm, myRightCm;
readonly bool myUseSuperJoin = DataStreamLoadFileConfig.instance.useNewJoin; protected bool myIsProject = true;
IDisposable? internalSubscription; private bool myUseSuperJoin = DataStreamLoadFileConfig.instance.useNewJoin;
IDisposable? projectSubscription;
protected JoinStream () {} protected JoinStream () {}
public JoinStream (ViewStream v1, string joinCol1, ColumnMap cm1, public JoinStream (ViewStream v1, string joinCol1, ColumnMap cm1,
@@ -117,61 +111,47 @@ namespace BCG
{ {
if (myPs == null) if (myPs == null)
{ {
ExceptionAssert.NotNull(myIjs, myLeftCm, myRightCm); JoinNameResolver resolver = new JoinNameResolver ((JoinTableSchema)myIjs.schema, myIjs.getSchema (true), myLeftCm.columnExpression,
var leftSchema = myIjs.getSchema(true) ?? throw new InvalidOperationException("Left schema is null"); myIjs.getSchema (false), myRightCm.columnExpression);
var rightSchema = myIjs.getSchema(true) ?? throw new InvalidOperationException("Right schema is null");
var joinSchema = (JoinTableSchema)myIjs.schema;
JoinNameResolver resolver = new JoinNameResolver(
joinSchema, leftSchema, myLeftCm.columnExpression, rightSchema, myRightCm.columnExpression);
IDictionary map = resolver.getMap (); IDictionary map = resolver.getMap ();
map["id"] = "id"; map["id"] = "id";
Disposable.Dispose(ref projectSubscription);
myPs = new ProjectStream (myIjs, map); myPs = new ProjectStream (myIjs, map);
projectSubscription = myPs.Subscribe(myProjectChangeHandler); myPs.onChange += new DataStream.ChangeDelegate (myProjectChangeHandler);
return; return;
} }
else else
Log.assert(false, "This call back should not have been called"); Log.assert(false, "This call back should not have been called");
} }
else { else
myFireEvent(cloneDataPacket(o)); myFireEvent ((o as ICloneable).Clone());
}
} }
private void myProjectChangeHandler (object o) private void myProjectChangeHandler (object o)
{ {
ExceptionAssert.NotNull(myIjs); if (myIjs.myOnChangeDelegate.GetInvocationList().Length > 1)
if (myIjs.numberOfSubscribers > 1) { myIjs.onChange -= new DataStream.ChangeDelegate (myInternalJoinChangeHandler);
Disposable.Dispose(ref internalSubscription); myFireEvent ((o as ICloneable).Clone());
}
myFireEvent(cloneDataPacket(o));
} }
protected override void myOnFirstSubscriber () protected override void myOnFirstSubscriber ()
{ {
Log.isnull(internalSubscription); myIjs.onChange += new DataStream.ChangeDelegate (myInternalJoinChangeHandler);
internalSubscription = ExceptionAssert.NotNull(myIjs).Subscribe(myInternalJoinChangeHandler);
} }
protected override void myOnLastSubscriber () protected override void myOnLastSubscriber ()
{ {
Disposable.Dispose(ref internalSubscription); // how does this relate to the -= in myProjectChangeHandler?
myIjs.onChange -= new DataStream.ChangeDelegate (myInternalJoinChangeHandler);
// if there is a project after the ijs we need to // if there is a project after the ijs we need to
// unsubscribe to it otherwise references will be kept and // unsubscribe to it otherwise references will be kept and
// a memory leak will occur // a memory leak will occur
Disposable.Dispose(ref projectSubscription); if (myPs != null)
myPs.onChange -= new DataStream.ChangeDelegate (myProjectChangeHandler);
myPs = null; myPs = null;
} }
object cloneDataPacket(object dpObj) {
var rv = (dpObj as ICloneable)?.Clone();
if (rv is null) {
var dp = (IDataPacket)dpObj;
rv = new DataPacket(new BlueTable(dp.newRows), new BlueTable(dp.addedRows), new BlueTable(dp.deletedRows));
}
return rv;
}
/**************************************TEST METHOD(S)*********************************************/ /**************************************TEST METHOD(S)*********************************************/
/// <summary> /// <summary>
/// Used for testing purposes only. This enables the test to work without a DataSource (PubServer, /// Used for testing purposes only. This enables the test to work without a DataSource (PubServer,
@@ -179,9 +159,7 @@ namespace BCG
/// </summary> /// </summary>
/// <param name="leftPacket"></param> /// <param name="leftPacket"></param>
/// <param name="rightPacket"></param> /// <param name="rightPacket"></param>
public void test (DataPacket dp, bool isLeft) { public void test (DataPacket dp, bool isLeft) {myIjs.test (dp, isLeft);}
ExceptionAssert.NotNull(myIjs).test(dp, isLeft);
}
/***********************************************************************************************/ /***********************************************************************************************/
} }
} }
@@ -1,17 +1,14 @@
using Bts.DataStreamCore;
using Spark.Core.Diagnostics;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.IO;
using BCG.Utilities.General;
namespace BCG namespace BCG
{ {
internal class JoinTable : IBlueRowCollection internal class JoinTable : IBlueRowCollection
{ {
protected JoinTableSchema mySchema; protected JoinTableSchema mySchema;
protected readonly Dictionary<int, IBlueRow> myIdIndex = new(); protected IDictionary myIdIndex = new Hashtable ();
protected JoinDeletionIndex myLeftIndex, myRightIndex; protected JoinDeletionIndex myLeftIndex, myRightIndex;
private int myNewRowId; private int myNewRowId;
@@ -22,16 +19,19 @@ namespace BCG
myRightIndex = new JoinDeletionIndex (mySchema.getRenamedName ("id", false), false); myRightIndex = new JoinDeletionIndex (mySchema.getRenamedName ("id", false), false);
} }
public IBlueRow this [int id] { public IBlueRow this [int id]
get { {
var rowObj = myIdIndex[id] get
?? throw new BlueDataException($"ID {id} does not exist in table {mySchema.tableName}"); {
return (IBlueRow)rowObj; if (myIdIndex[id] == null)
throw new BlueDataException ("ID " + id.ToString() + " does not exist in table " + mySchema.tableName);
return (IBlueRow)myIdIndex[id];
} }
} }
#region JoinTable members #region JoinTable members
public virtual void addRow(IBlueRow leftRow, IBlueRow? rightRow, IDataPacket dp) { public virtual void addRow (IBlueRow leftRow, IBlueRow rightRow, DataPacket dp)
{
JoinRow newRow = new JoinRow (myNewRowId, leftRow, rightRow, mySchema); JoinRow newRow = new JoinRow (myNewRowId, leftRow, rightRow, mySchema);
myIdIndex[myNewRowId ++] = newRow; myIdIndex[myNewRowId ++] = newRow;
((BlueTable)(dp.addedRows)).addRow (newRow); ((BlueTable)(dp.addedRows)).addRow (newRow);
@@ -40,7 +40,7 @@ namespace BCG
myRightIndex.add (newRow); myRightIndex.add (newRow);
} }
public virtual void deleteRow (bool isLeft, IBlueRow deletedRow, IDataPacket dp) public virtual void deleteRow (bool isLeft, IBlueRow deletedRow, DataPacket dp)
{ {
JoinDeletionIndex thisIndex = myRightIndex, otherIndex = myLeftIndex; JoinDeletionIndex thisIndex = myRightIndex, otherIndex = myLeftIndex;
if (isLeft) if (isLeft)
@@ -48,17 +48,17 @@ namespace BCG
thisIndex = myLeftIndex; thisIndex = myLeftIndex;
otherIndex = myRightIndex; otherIndex = myRightIndex;
} }
RowList matchingNodes = thisIndex.getMatchingRows(deletedRow.Id()); RowList matchingNodes = thisIndex.getMatchingRows (deletedRow["id"]);
foreach (RowNode node in matchingNodes) foreach (RowNode node in matchingNodes)
{ {
var row = ExceptionAssert.Argument.Is<JoinRow>(node.row); JoinRow row = (JoinRow)node.row;
RowNode? correspondingNode = isLeft ? row.rightNode : row.leftNode; RowNode correspondingNode = isLeft ? row.rightNode : row.leftNode;
if (correspondingNode != null) if (correspondingNode != null)
otherIndex.remove (correspondingNode); //in case of partial left joinss otherIndex.remove (correspondingNode); //in case of partial left joinss
myIdIndex.Remove(row.Id()); myIdIndex.Remove (row["id"]);
((BlueTable)dp.deletedRows).addRow (row); ((BlueTable)dp.deletedRows).addRow (row);
} }
thisIndex.removeAll(deletedRow.Id()); thisIndex.removeAll (deletedRow["id"]);
} }
#endregion #endregion
#region ICollection members #region ICollection members
@@ -68,11 +68,7 @@ namespace BCG
public object SyncRoot{get{return this;}} public object SyncRoot{get{return this;}}
public void CopyTo (Array array, int index) { public void CopyTo (Array array, int index) {myIdIndex.Values.CopyTo (array, index);}
foreach (var row in myIdIndex.Values) {
array.SetValue(row, index++);
}
}
#endregion #endregion
#region IEnumerable members #region IEnumerable members
@@ -1,7 +1,8 @@
using bts; using System;
using System.Collections;
using BCG.Utilities;
using System.Collections.Generic; using bts;
using System.Linq;
namespace BCG namespace BCG
{ {
@@ -12,11 +13,10 @@ namespace BCG
public class JoinTableSchema : BlueTableSchema public class JoinTableSchema : BlueTableSchema
{ {
private string myLeftJc = "", myRightJc = "", myLeftId = "", myRightId = ""; private string myLeftJc = "", myRightJc = "", myLeftId = "", myRightId = "";
readonly Dictionary<string, string> myLeftNameToAlias = new(); private IDictionary myLeftNameToAlias = new Hashtable ();
readonly Dictionary<string, string> myRightNameToAlias = new(); private IDictionary myRightNameToAlias = new Hashtable ();
readonly Dictionary<string, string> myAliasToLeftName = new(); private IDictionary myAliasToLeftName = new Hashtable(),
readonly Dictionary<string, string> myAliasToRightName = new(); myAliasToRightName = new Hashtable();
/// <summary> /// <summary>
/// Constructs the schema of the Jointable with the schema of the left and right tables. Incase of /// Constructs the schema of the Jointable with the schema of the left and right tables. Incase of
/// a name being there in both the shemas it prefixes the name with "L." or "R." accordingly. Column "id" /// a name being there in both the shemas it prefixes the name with "L." or "R." accordingly. Column "id"
@@ -85,9 +85,9 @@ namespace BCG
renamed = false; renamed = false;
} }
myIndexByColName["id"] = new ColumnInfo("id", myIndexByColName.Count, typeof(int)); myIndexByColName["id"] = new ColumnInfo("id", myIndexByColName.Count, typeof(int));
myIndexByColOrder[myIndexByColOrder.Length - 1] = myIndexByColName["id"]; myIndexByColOrder[myIndexByColOrder.Length - 1] = (ColumnInfo)myIndexByColName["id"];
myAliasToLeftName = myLeftNameToAlias.ToDictionary(kv => kv.Value, kv => kv.Key); myAliasToLeftName = ProjectHelper.invertDic(myLeftNameToAlias);
myAliasToRightName = myRightNameToAlias.ToDictionary(kv => kv.Value, kv => kv.Key); myAliasToRightName = ProjectHelper.invertDic(myRightNameToAlias);
} }
public string leftJoinCol {get{return myLeftJc;}} public string leftJoinCol {get{return myLeftJc;}}
@@ -1,21 +1,17 @@
using bts; using bts;
using bts.collections; using bts.collections;
using Bts.DataStreamCore;
using mbts; using mbts;
using Spark.Core.Diagnostics;
using Spark.Core.Disposables;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Linq;
using System.Security.Cryptography;
namespace BCG { namespace BCG {
public class NonIncJoinBookkeeper : IDisposable { public class NonIncJoinBookkeeper : IDisposable {
public event Action? on_new_data; public Action on_new_data;
private readonly NonIncJoinSpec _join_spec; private readonly NonIncJoinSpec _join_spec;
private readonly int _join_position; private readonly int _join_position;
private readonly int _start_index_in_output; private readonly int _start_index_in_output;
@@ -24,14 +20,13 @@ namespace BCG {
private readonly bool _is_tag_along; private readonly bool _is_tag_along;
private int _n_total_fires = 0, _n_expensive_fires = 0; private int _n_total_fires = 0, _n_expensive_fires = 0;
IBlueTableSchema? _schema; private IBlueTableSchema _schema = null;
private IDictionary<int, IBlueRow> _row_map = new Dictionary<int, IBlueRow>(); private IDictionary<int, IBlueRow> _row_map = new Dictionary<int, IBlueRow>();
private List<Pair<int, IBlueRow>> _row_list = new List<Pair<int, IBlueRow>>(); private List<Pair<int, IBlueRow>> _row_list = new List<Pair<int, IBlueRow>>();
IBlueRow? _solitary_row; private IBlueRow _solitary_row = null;
int[]? _join_col_indices; private int[] _join_col_indices = null,
int[]? _data_col_indices; _data_col_indices = null;
IDisposable? subscription;
public NonIncJoinBookkeeper(NonIncJoinSpec the_join_spec, int join_position, int start_index_in_output, BlueRowHasher row_hasher) { public NonIncJoinBookkeeper(NonIncJoinSpec the_join_spec, int join_position, int start_index_in_output, BlueRowHasher row_hasher) {
_join_spec = the_join_spec; _join_spec = the_join_spec;
@@ -43,7 +38,7 @@ namespace BCG {
} }
private bool _filled_missing_data = false; private bool _filled_missing_data = false;
void _fill_missing_data(IDataPacket dp) { private void _fill_missing_data(DataPacket dp) {
if (_filled_missing_data) if (_filled_missing_data)
return; return;
Func<string[], bool> null_or_empty = (str_arr) => { Func<string[], bool> null_or_empty = (str_arr) => {
@@ -57,17 +52,17 @@ namespace BCG {
return true; return true;
}; };
Func<string[], string[]> remove_bad_cols = (col_names) => { Func<string[], string[]> remove_bad_cols = (col_names) => {
HashSet<string> schema_col_map = new HashSet<string>(dp.Schema.columnNames); HashSet<string> schema_col_map = new HashSet<string>(dp.schema.columnNames);
List<string> cols_list = new List<string>(col_names); List<string> cols_list = new List<string>(col_names);
cols_list.RemoveWhere(c => !schema_col_map.Contains(c)); cols_list.RemoveWhere(c => !schema_col_map.Contains(c));
return cols_list.ToArray(); return cols_list.ToArray();
}; };
if (null_or_empty(_join_spec.data_col_names)) { if (null_or_empty(_join_spec.data_col_names)) {
_join_spec.data_col_names = dp.Schema.columnNames; _join_spec.data_col_names = dp.schema.columnNames;
} }
_join_spec.data_col_names = remove_bad_cols(_join_spec.data_col_names); _join_spec.data_col_names = remove_bad_cols(_join_spec.data_col_names);
if (null_or_empty(_join_spec.data_col_names)) { if (null_or_empty(_join_spec.data_col_names)) {
_join_spec.data_col_names = dp.Schema.columnNames; _join_spec.data_col_names = dp.schema.columnNames;
} }
if (null_or_empty(_join_spec.projected_col_names)) { if (null_or_empty(_join_spec.projected_col_names)) {
_join_spec.projected_col_names = _join_spec.data_col_names; _join_spec.projected_col_names = _join_spec.data_col_names;
@@ -75,16 +70,20 @@ namespace BCG {
} }
public void init() { public void init() {
ExceptionAssert.MemberIsNull(subscription); _join_spec.stream.onChange += _on_stream_cb;
subscription = ExceptionAssert.MemberNotNull(_join_spec.stream).Subscribe(_on_stream_cb);
} }
public void _on_stream_cb(object dp_obj) { public void _on_stream_cb(object dp_obj) {
//Log.Gen.info($"NonIncJoinBookkeeper._on_stream_cb dp_obj: {dp_obj}"); //Log.Gen.info($"NonIncJoinBookkeeper._on_stream_cb dp_obj: {dp_obj}");
var timer = Stopwatch.StartNew(); var timer = Stopwatch.StartNew();
var dp = (IDataPacket)dp_obj; DataPacket dp = (DataPacket)dp_obj;
_fill_missing_data(dp); _fill_missing_data(dp);
init(dp); if (_schema == null) {
_schema = dp.schema;
_join_col_indices = BlueDataUtility.get_column_indices(_schema, _join_spec.join_col_names);
_data_col_indices = BlueDataUtility.get_column_indices(_schema, _join_spec.data_col_names);
}
if (_is_left_most) { if (_is_left_most) {
_row_list.Clear(); _row_list.Clear();
foreach (IBlueRow r in dp.newRows) foreach (IBlueRow r in dp.newRows)
@@ -109,68 +108,44 @@ namespace BCG {
on_new_data(); on_new_data();
} }
[MemberNotNullWhen(true, nameof(_schema))]
public bool is_ready { get { return _schema != null; } } public bool is_ready { get { return _schema != null; } }
public void constribute_cols_to_schema(List<ColumnInfo> cis) { public void constribute_cols_to_schema(List<ColumnInfo> cis) {
requireReady();
for (int i = 0; i < _join_spec.data_col_names.Length; i++) for (int i = 0; i < _join_spec.data_col_names.Length; i++)
cis.Add(new ColumnInfo(_join_spec.projected_col_names[i], cis.Count, _schema[_join_spec.data_col_names[i]].colType)); cis.Add(new ColumnInfo(_join_spec.projected_col_names[i], cis.Count, _schema[_join_spec.data_col_names[i]].colType));
} }
public List<Pair<int, IBlueRow>> get_list() { return _row_list; } public List<Pair<int, IBlueRow>> get_list() { return _row_list; }
public void copy_master_row_to_output_row(int row_index, object?[] output_row) => public void copy_master_row_to_output_row(int row_index, object[] output_row) {
copyRow(ExceptionAssert.NotNull(_row_list[row_index].second), output_row); IBlueRow this_row = _row_list[row_index].second;
BlueDataUtility.copy_to_row(this_row, _data_col_indices, output_row, _start_index_in_output);
}
public void copy_matching_row_to_output_row(int row_hash, object?[] output_row) { public void copy_matching_row_to_output_row(int row_hash, object[] output_row) {
if (_is_tag_along) { if (_is_tag_along) {
if (_solitary_row != null) if (_solitary_row != null)
copyRow(_solitary_row, output_row); BlueDataUtility.copy_to_row(_solitary_row, _data_col_indices, output_row, _start_index_in_output);
else else
copy_dbnull_to_output_row(output_row); copy_dbnull_to_output_row(output_row);
} else { } else {
if (_row_map.TryGetValue(row_hash, out var this_row)) IBlueRow this_row = null;
copyRow(this_row, output_row); if (_row_map.TryGetValue(row_hash, out this_row))
BlueDataUtility.copy_to_row(this_row, _data_col_indices, output_row, _start_index_in_output);
else else
copy_dbnull_to_output_row(output_row); copy_dbnull_to_output_row(output_row);
} }
} }
void copy_dbnull_to_output_row(object?[] output_row) { private void copy_dbnull_to_output_row(object[] output_row) {
requireDataColIndices();
for (int i = 0; i < _data_col_indices.Length; i++) for (int i = 0; i < _data_col_indices.Length; i++)
output_row[i + _start_index_in_output] = DBNull.Value; output_row[i + _start_index_in_output] = DBNull.Value;
} }
#region IDisposable #region IDisposable
public void Dispose() => public void Dispose() { _join_spec.stream.onChange -= _on_stream_cb; }
Disposable.Dispose(ref subscription);
#endregion #endregion
void copyRow(IBlueRow src, object?[] dst) {
requireDataColIndices();
BlueDataUtility.copy_to_row(src, _data_col_indices, dst, _start_index_in_output);
}
[MemberNotNull(nameof(_schema), nameof(_join_col_indices), nameof(_data_col_indices))]
void init(IDataPacket dp) {
_schema ??= dp.Schema;
_join_col_indices ??= BlueDataUtility.get_column_indices(_schema, _join_spec.join_col_names);
_data_col_indices ??= BlueDataUtility.get_column_indices(_schema, _join_spec.data_col_names);
}
[MemberNotNull(nameof(_data_col_indices))]
int[] requireDataColIndices() =>
ExceptionAssert.NotNull(_data_col_indices);
[MemberNotNull(nameof(_schema))]
void requireReady() {
if (!is_ready) {
throw new InvalidOperationException("Not ready");
}
}
} }
} }
@@ -1,25 +1,22 @@
using mbts; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using mbts;
namespace BCG { namespace BCG {
// this a collection of data, theres no joining logic in here // this a collection of data, theres no joining logic in here
public class NonIncJoinSpec { public class NonIncJoinSpec {
public ViewStream? stream; public ViewStream stream;
// join col names are the names on which the streams are joined (for equality), // join col names are the names on which the streams are joined (for equality),
// data col names are the names in the original stream // data col names are the names in the original stream
// projected col names are their new names, ie if its x:l_x, then x is in the // projected col names are their new names, ie if its x:l_x, then x is in the
// data_col_names and l_x in projected cols // data_col_names and l_x in projected cols
public string[] join_col_names; public string[] join_col_names, data_col_names, projected_col_names;
public string[] data_col_names;
public string[] projected_col_names;
public NonIncJoinSpec() { public NonIncJoinSpec() { }
join_col_names = Array.Empty<string>();
data_col_names = Array.Empty<string>();
projected_col_names = Array.Empty<string>();
}
public NonIncJoinSpec(ViewStream the_stream, string[] the_join_col_names, string[] the_data_col_names) public NonIncJoinSpec(ViewStream the_stream, string[] the_join_col_names, string[] the_data_col_names)
: this(the_stream, the_join_col_names, the_data_col_names, the_data_col_names) { } : this(the_stream, the_join_col_names, the_data_col_names, the_data_col_names) { }
@@ -5,19 +5,18 @@ using mbts;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace BCG { namespace BCG {
[DataStreamUserRespresentation("fastJoin")] [DataStreamUserRespresentation("fastJoin")]
public class NonIncJoinStream : ViewStream, BCG.Utilities.General.IWorker { public class NonIncJoinStream : ViewStream, BCG.Utilities.General.IWorker {
private readonly NonIncJoinSpec[] _join_specs; private readonly NonIncJoinSpec[] _join_specs;
readonly INonIncJoinInlineMapper? _output_mapper; private readonly INonIncJoinInlineMapper _output_mapper;
private readonly BlueRowHasher _row_hasher; private readonly BlueRowHasher _row_hasher;
private readonly TimeSpan _throttle_period; private readonly TimeSpan _throttle_period;
private readonly ViewStreamDatabase _vsd; private readonly ViewStreamDatabase _vsd;
private List<NonIncJoinBookkeeper> _book_keeping_data = new List<NonIncJoinBookkeeper>(); private List<NonIncJoinBookkeeper> _book_keeping_data = new List<NonIncJoinBookkeeper>();
IBlueTableSchema? _output_schema; private IBlueTableSchema _output_schema = null;
private DateTime _last_fire_time = DateTime.MinValue; private DateTime _last_fire_time = DateTime.MinValue;
private bool _is_dirty = false; private bool _is_dirty = false;
@@ -36,10 +35,10 @@ namespace BCG {
params Triplet<ViewStream, string, string>[] join_specs) params Triplet<ViewStream, string, string>[] join_specs)
: this(vsd, NonIncJoinSpec.from_triplet(join_specs), output_mapper, throttles_ms) { } : this(vsd, NonIncJoinSpec.from_triplet(join_specs), output_mapper, throttles_ms) { }
public NonIncJoinStream(NonIncJoinSpec[] join_specs, INonIncJoinInlineMapper? output_mapper, int throttles_ms = 0) public NonIncJoinStream(NonIncJoinSpec[] join_specs, INonIncJoinInlineMapper output_mapper, int throttles_ms = 0)
: this(ViewStreamDatabase.instance, join_specs, output_mapper, throttles_ms) { } : this(ViewStreamDatabase.instance, join_specs, output_mapper, throttles_ms) { }
public NonIncJoinStream(ViewStreamDatabase vsd, NonIncJoinSpec[] join_specs, INonIncJoinInlineMapper? output_mapper, int throttles_ms = 0) { public NonIncJoinStream(ViewStreamDatabase vsd, NonIncJoinSpec[] join_specs, INonIncJoinInlineMapper output_mapper, int throttles_ms = 0) {
_join_specs = join_specs; _join_specs = join_specs;
_output_mapper = output_mapper; _output_mapper = output_mapper;
_row_hasher = new BlueRowHasher(_join_specs[0].join_col_names.Length); _row_hasher = new BlueRowHasher(_join_specs[0].join_col_names.Length);
@@ -89,7 +88,6 @@ namespace BCG {
return rv; return rv;
} }
[MemberNotNull(nameof(_output_schema))]
private void _construct_schema() { private void _construct_schema() {
if (_output_schema == null) { if (_output_schema == null) {
List<ColumnInfo> cis = new List<ColumnInfo>(new ColumnInfo[] { new ColumnInfo("id", 0, typeof(int)) }); List<ColumnInfo> cis = new List<ColumnInfo>(new ColumnInfo[] { new ColumnInfo("id", 0, typeof(int)) });
@@ -1,7 +1,9 @@
#nullable disable using System;
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using BCG.Utilities.General;
using BCG.Utilities;
namespace BCG namespace BCG
{ {
@@ -2,12 +2,11 @@ namespace bts {
using BCG; using BCG;
using BCG.Utilities.General; using BCG.Utilities.General;
using Spark.Core.Diagnostics;
using Spark.Core.Disposables;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using ZstdSharp.Unsafe;
// functon that joins the 2 rows and returns the outputput row. The function // functon that joins the 2 rows and returns the outputput row. The function
// can return a null which means the 2 rows dont need to be joined // can return a null which means the 2 rows dont need to be joined
using JoinFunc = System.Func<BCG.IBlueRow, BCG.IBlueRow, BCG.IBlueRow>; using JoinFunc = System.Func<BCG.IBlueRow, BCG.IBlueRow, BCG.IBlueRow>;
@@ -17,10 +16,6 @@ namespace bts {
private bool _dirty = false; private bool _dirty = false;
private Stopwatch _stopwatch = new Stopwatch(); private Stopwatch _stopwatch = new Stopwatch();
private ViewStreamDatabase _vsd = ViewStreamDatabase.instance; private ViewStreamDatabase _vsd = ViewStreamDatabase.instance;
IDisposable? subscription;
IBlueRowCollection? leftRows;
IBlueRowCollection? rightRows;
public ProximityJoinStream(ViewStream lvs, ViewStream rvs, JoinFunc join_func) { public ProximityJoinStream(ViewStream lvs, ViewStream rvs, JoinFunc join_func) {
_lvs = lvs; _lvs = lvs;
_rvs = rvs; _rvs = rvs;
@@ -28,56 +23,46 @@ namespace bts {
} }
protected override void myOnFirstSubscriber() { protected override void myOnFirstSubscriber() {
_lvs.onChange += OnLeftChange; _lvs.onChange += _handle_data;
_rvs.onChange += OnRightChange; _rvs.onChange += _handle_data;
subscription = Disposable.Create(Unsubscribe);
_vsd.addWorker(this); _vsd.addWorker(this);
void OnLeftChange(object dp_obj) {
leftRows = ExceptionAssert.Argument.Is<IDataPacket>(dp_obj).newRows;
_dirty = true;
doWork();
}
void OnRightChange(object dp_obj) {
rightRows = ExceptionAssert.Argument.Is<IDataPacket>(dp_obj).newRows;
_dirty = true;
doWork();
}
void Unsubscribe() {
_lvs.onChange -= OnLeftChange;
_rvs.onChange -= OnRightChange;
}
} }
protected override void myOnLastSubscriber() { protected override void myOnLastSubscriber() {
subscription?.Dispose(); _lvs.onChange -= _handle_data;
subscription = null; _rvs.onChange -= _handle_data;
_vsd.removeWorker(this); _vsd.removeWorker(this);
} }
private void _handle_data(object dp_obj) {
_dirty = true;
doWork();
}
public void doWork() { public void doWork() {
if (!_dirty || leftRows is null || rightRows is null) { Func<bool> all_data_revcd = () => {
return; return _lvs.rows != null && _rvs.rows != null;
} };
_stopwatch.Start(); _stopwatch.Start();
_dirty = false; if (_dirty && all_data_revcd()) {
BlueTable? rv = null; _dirty = false;
foreach (IBlueRow lr in leftRows) { BlueTable rv = null;
foreach (IBlueRow rr in rightRows) { foreach (IBlueRow lr in _lvs.rows) {
IBlueRow resr = _join_func(lr, rr); foreach (IBlueRow rr in _rvs.rows) {
if (resr == null) IBlueRow resr = _join_func(lr, rr);
continue; if (resr == null)
rv = rv ?? new BlueTable(resr.schema); continue;
rv.addRow(resr); rv = rv ?? new BlueTable(resr.schema);
rv.addRow(resr);
}
} }
_stopwatch.Stop();
Log.Gen.info($"ProximityJoinStream left_count: {_lvs.rows.Count} right_count: {_rvs.rows.Count} result_count: {rv.Count} time: {_stopwatch.ElapsedMilliseconds} msecs");
var dp = BlueDataUtility.build_dp_inc(rv, myLastValue as DataPacket);
myFireEvent(dp);
} }
_stopwatch.Stop();
Log.Gen.info($"ProximityJoinStream left_count: {leftRows.Count} right_count: {rightRows.Count} result_count: {rv?.Count ?? 0} time: {_stopwatch.ElapsedMilliseconds} msecs");
var dp = BlueDataUtility.build_dp_inc(rv, myLastValue as DataPacket);
myFireEvent(dp);
} }
} }
} }
@@ -1,5 +1,3 @@
using Spark.Core.Diagnostics;
using System; using System;
using System.Collections; using System.Collections;
@@ -11,7 +9,7 @@ namespace BCG
/// </summary> /// </summary>
internal class RowList : ICollection internal class RowList : ICollection
{ {
RowNode? myFirstPtr; private RowNode myFirstPtr;
private int myCount = 0; private int myCount = 0;
#region ICollection methods #region ICollection methods
@@ -69,19 +67,19 @@ namespace BCG
} }
else if (node.isFirst) else if (node.isFirst)
{ {
myFirstPtr = ExceptionAssert.NotNull(myFirstPtr).next; myFirstPtr = myFirstPtr.next;
ExceptionAssert.NotNull(myFirstPtr).previous = null; myFirstPtr.previous = null;
return; return;
} }
else if (node.isLast) else if (node.isLast)
{ {
ExceptionAssert.NotNull(node.previous).next = null; node.previous.next = null;
return; return;
} }
else if (!node.isFirst && !node.isLast) else if (!node.isFirst && !node.isLast)
{ {
ExceptionAssert.NotNull(node.previous).next = node.next; node.previous.next = node.next;
ExceptionAssert.NotNull(node.next).previous = node.previous; node.next.previous = node.previous;
return; return;
} }
else else
@@ -93,16 +91,14 @@ namespace BCG
internal class RowListEnumerator : IEnumerator internal class RowListEnumerator : IEnumerator
{ {
RowNode? myPointer; private RowNode myPointer;
private RowList myList; private RowList myList;
private int myPos = -1; private int myPos = -1;
public RowListEnumerator (RowList list) {myList = list;} public RowListEnumerator (RowList list) {myList = list;}
public object? Current => myPointer; public object Current {get{return myPointer;}}
public bool MoveNext() public bool MoveNext()
{ {
myPointer = myPos == -1 myPointer = myPos == -1 ? myList.myFirstPtr : myPointer.next;
? myList.myFirstPtr
: ExceptionAssert.NotNull(myPointer).next;
myPos ++; myPos ++;
return myPointer != null; return myPointer != null;
} }
@@ -112,24 +108,28 @@ namespace BCG
internal class RowNode internal class RowNode
{ {
public RowNode (IBlueRow row) => private IBlueRow myRow;
this.row = row; private RowNode myNext;
private RowNode myPrevious;
public RowNode (IBlueRow row, RowList list) private RowList myList;
: this(row) =>
this.list = list; public RowNode (IBlueRow row){myRow = row;}
public RowNode (IBlueRow row, RowList list) : this (row) {myList = list;}
public bool isLast => next is null; public bool isLast {get{return myNext == null;}}
public bool isFirst => previous is null; public bool isFirst {get{return myPrevious == null;}}
public RowList? list { get; } public RowList list {get{return myList;}}
public IBlueRow? row { get; set; } public IBlueRow row
public RowNode? next { get; set; } {
public RowNode? previous { get; set; } get{return myRow;}
set{myRow = value;}
public RowList RequireList() => }
ExceptionAssert.MemberNotNull(list); public RowNode next {
get{return myNext;}
public IBlueRow RequireRow() => set{myNext = value;}
ExceptionAssert.MemberNotNull(row); }
public RowNode previous {
get{return myPrevious;}
set{myPrevious = value;}
}
} }
} }
@@ -1,17 +1,125 @@
using Bts.DataStreamCore;
using mbts;
using Spark.Core.Collections;
using Spark.Core.Diagnostics;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis; using mbts;
using Spark.Core.Collections;
namespace BCG namespace BCG
{ {
internal class SingleRowJoinDicionary<TKey, TValue> : IDictionary<TKey, TValue>
{
private TKey myKey;
private TValue myValue;
#region IDictionary<TKey,TValue> Members
public void Add(TKey key, TValue value)
{
myKey = key;
myValue = value;
}
public bool ContainsKey(TKey key)
{
return myKey.Equals(key);
}
public ICollection<TKey> Keys
{
get { return new TKey[] { myKey }; }
}
public bool Remove(TKey key)
{
bool rv = myKey.Equals(key);
myKey = default(TKey);
return rv;
}
public bool TryGetValue(TKey key, out TValue value)
{
bool rv = false;
value = (rv = myKey.Equals(key)) ? myValue : default(TValue);
return rv;
}
public ICollection<TValue> Values
{
get { throw new Exception("The method or operation is not implemented."); }
}
public TValue this[TKey key]
{
get
{
throw new Exception("The method or operation is not implemented.");
}
set
{
throw new Exception("The method or operation is not implemented.");
}
}
#endregion
#region ICollection<KeyValuePair<TKey,TValue>> Members
public void Add(KeyValuePair<TKey, TValue> item)
{
throw new Exception("The method or operation is not implemented.");
}
public void Clear()
{
throw new Exception("The method or operation is not implemented.");
}
public bool Contains(KeyValuePair<TKey, TValue> item)
{
throw new Exception("The method or operation is not implemented.");
}
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
{
throw new Exception("The method or operation is not implemented.");
}
public int Count
{
get { throw new Exception("The method or operation is not implemented."); }
}
public bool IsReadOnly
{
get { throw new Exception("The method or operation is not implemented."); }
}
public bool Remove(KeyValuePair<TKey, TValue> item)
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
#region IEnumerable<KeyValuePair<TKey,TValue>> Members
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator()
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
}
#region Helper class to deal with stream projections #region Helper class to deal with stream projections
public class JoinProjectHelper public class JoinProjectHelper
@@ -59,7 +167,7 @@ namespace BCG
{ {
Pair<string, bool> p = myAliasToOriginal[col]; Pair<string, bool> p = myAliasToOriginal[col];
isLeft = p.second; isLeft = p.second;
return ExceptionAssert.NotNull(p.first); return p.first;
} }
} }
@@ -70,11 +178,10 @@ namespace BCG
public class SuperJoinRow : IBlueRow public class SuperJoinRow : IBlueRow
{ {
private JoinProjectHelper myHelper; private JoinProjectHelper myHelper;
IBlueRow myLeftRow; private IBlueRow myLeftRow, myRightRow;
IBlueRow? myRightRow;
int myID; int myID;
public SuperJoinRow(int id, IBlueRow leftRow, IBlueRow? rightRow, JoinProjectHelper joinProjectHelper) public SuperJoinRow(int id, IBlueRow leftRow, IBlueRow rightRow, JoinProjectHelper joinProjectHelper)
{ {
myID = id; myID = id;
myLeftRow = leftRow; myLeftRow = leftRow;
@@ -82,22 +189,21 @@ namespace BCG
myHelper = joinProjectHelper; myHelper = joinProjectHelper;
} }
public int leftID => myLeftRow.Id(); public int leftID { get { return (int)myLeftRow["id"]; } }
public int rightID => myRightRow.Id(); public int rightID { get { return (int)myRightRow["id"]; } }
public IBlueRow leftRow { get { return myLeftRow; } } public IBlueRow leftRow { get { return myLeftRow; } }
public IBlueRow? rightRow => myRightRow; public IBlueRow rightRow { get { return myRightRow; } }
#region IBlueRow Members #region IBlueRow Members
public IBlueTableSchema schema { get { return myHelper.schema; } } public IBlueTableSchema schema { get { return myHelper.schema; } }
public object? this[int index] => public object this[int index] { get { return this[schema[index].colName]; } }
this[schema[index].colName];
public object? this[string colName] public object this[string colName]
{ {
get get
{ {
@@ -123,7 +229,7 @@ namespace BCG
public bool Contains(object key) public bool Contains(object key)
{ {
return myLeftRow.Contains(key) || (myRightRow?.Contains(key) ?? false); return myLeftRow.Contains(key) || myRightRow.Contains(key);
} }
public System.Collections.IDictionaryEnumerator GetEnumerator() { return new BlueRowDictionaryEnumerator(this); } public System.Collections.IDictionaryEnumerator GetEnumerator() { return new BlueRowDictionaryEnumerator(this); }
@@ -136,11 +242,11 @@ namespace BCG
public void Remove(object key) { throw new NotSupportedException("IBlueRow is readonly"); } public void Remove(object key) { throw new NotSupportedException("IBlueRow is readonly"); }
public ICollection Values public System.Collections.ICollection Values
{ {
get get
{ {
var rv = new List<object?>(Keys.Count); List<object> rv = new List<object>();
foreach (string col in Keys) foreach (string col in Keys)
rv.Add(this[col]); rv.Add(this[col]);
return rv; return rv;
@@ -185,10 +291,9 @@ namespace BCG
myLeftUnmatchedRowsDels = new Dictionary<int, IBlueRow>(); myLeftUnmatchedRowsDels = new Dictionary<int, IBlueRow>();
private bool myManageUnmappedLeftRows = false; private bool myManageUnmappedLeftRows = false;
protected string myLeftProj = String.Empty, myRightProj = String.Empty; protected string myLeftProj = String.Empty, myRightProj = String.Empty;
protected IBlueTableSchema? myLeftSchema; protected IBlueTableSchema myLeftSchema, myRightSchema;
protected IBlueTableSchema? myRightSchema; protected JoinProjectHelper myJoinProjectHelper;
protected JoinProjectHelper? myJoinProjectHelper; protected BlueTable myState;
protected BlueTable? myState;
protected int myID; protected int myID;
protected ViewStream myLeftStream, myRightStream; protected ViewStream myLeftStream, myRightStream;
protected string myLeftKeyCol, myRightKeyCol; protected string myLeftKeyCol, myRightKeyCol;
@@ -241,19 +346,23 @@ namespace BCG
private void myHandleLeftStreamChanges(object newValue) private void myHandleLeftStreamChanges(object newValue)
{ {
myHandleStreamChanges((IDataPacket)newValue, true); myHandleStreamChanges(newValue as DataPacket, true);
} }
private void myHandleRightStreamChanges(object newValue) private void myHandleRightStreamChanges(object newValue)
{ {
myHandleStreamChanges((IDataPacket)newValue, false); myHandleStreamChanges(newValue as DataPacket, false);
} }
private void myHandleStreamChanges(IDataPacket dp, bool isLeft) private void myHandleStreamChanges(DataPacket dp, bool isLeft)
{ {
myInitSchema(dp.Schema, isLeft); myInitSchema(dp.schema, isLeft);
var dels = new BlueTable(myState.schema); BlueTable dels = null, adds = null;
var adds = new BlueTable(myState.schema); if (myState != null)
{
dels = new BlueTable(myState.schema);
adds = new BlueTable(myState.schema);
}
myDeleteRows(dp.deletedRows, isLeft, myState, dels); myDeleteRows(dp.deletedRows, isLeft, myState, dels);
myAddRows(dp.addedRows, isLeft, myState, adds); myAddRows(dp.addedRows, isLeft, myState, adds);
if (myState != null) if (myState != null)
@@ -264,7 +373,6 @@ namespace BCG
} }
} }
[MemberNotNull(nameof(myState))]
private void myInitSchema(IBlueTableSchema schema, bool isLeft) private void myInitSchema(IBlueTableSchema schema, bool isLeft)
{ {
if (myState == null) if (myState == null)
@@ -294,7 +402,6 @@ namespace BCG
private void myAddRows(IBlueRowCollection addedRows, bool isLeft, BlueTable state, BlueTable addedRowsOut) private void myAddRows(IBlueRowCollection addedRows, bool isLeft, BlueTable state, BlueTable addedRowsOut)
{ {
ExceptionAssert.NotNull(myJoinProjectHelper);
object thisKeyCol = isLeft ? myLeftKeyCol : myRightKeyCol, object thisKeyCol = isLeft ? myLeftKeyCol : myRightKeyCol,
otherSideKeyCol = isLeft ? myRightKeyCol : myLeftKeyCol; otherSideKeyCol = isLeft ? myRightKeyCol : myLeftKeyCol;
Dictionary<object, IDictionary<int, IBlueRow>> thisKeyToRows = isLeft ? myLeftKeyToLeftRows : myRightKeyToRightRows, Dictionary<object, IDictionary<int, IBlueRow>> thisKeyToRows = isLeft ? myLeftKeyToLeftRows : myRightKeyToRightRows,
@@ -303,8 +410,8 @@ namespace BCG
otherIDToResultRows = isLeft ? myRightIDToResultRows : myLeftIDToResultRows; otherIDToResultRows = isLeft ? myRightIDToResultRows : myLeftIDToResultRows;
foreach (IBlueRow r in addedRows) foreach (IBlueRow r in addedRows)
{ {
object currentKey = ExceptionAssert.NotNull(r[thisKeyCol]); object currentKey = r[thisKeyCol];
int currentID = r.Id(); int currentID = (int)r["id"];
///add it to 1. ///add it to 1.
if (!thisKeyToRows.ContainsKey(currentKey)) if (!thisKeyToRows.ContainsKey(currentKey))
thisKeyToRows.Add(currentKey, new Dictionary<int, IBlueRow>()); thisKeyToRows.Add(currentKey, new Dictionary<int, IBlueRow>());
@@ -315,14 +422,14 @@ namespace BCG
ICollection<IBlueRow> matchingRows = otherSideKeyToRows[currentKey].Values; ICollection<IBlueRow> matchingRows = otherSideKeyToRows[currentKey].Values;
foreach (IBlueRow mr in matchingRows) foreach (IBlueRow mr in matchingRows)
{ {
int mrID = mr.Id(); int mrID = (int)mr["id"];
SuperJoinRow rr = new SuperJoinRow(myID++, isLeft ? r : mr, isLeft ? mr : r, myJoinProjectHelper); SuperJoinRow rr = new SuperJoinRow(myID++, isLeft ? r : mr, isLeft ? mr : r, myJoinProjectHelper);
state.addRow(rr); state.addRow(rr);
addedRowsOut.addRow(rr); addedRowsOut.addRow(rr);
///add to 3. ///add to 3.
if (!thisIDToResultRows.ContainsKey(currentID)) if (!thisIDToResultRows.ContainsKey(currentID))
thisIDToResultRows.Add(currentID, new Dictionary<int, SuperJoinRow>()); thisIDToResultRows.Add(currentID, new Dictionary<int, SuperJoinRow>());
thisIDToResultRows[currentID].Add(rr.Id(), rr); thisIDToResultRows[currentID].Add((int)rr["id"], rr);
///add to 4. ///add to 4.
if (!otherIDToResultRows.ContainsKey(mrID)) if (!otherIDToResultRows.ContainsKey(mrID))
{ {
@@ -330,7 +437,7 @@ namespace BCG
if (myManageUnmappedLeftRows && !isLeft) if (myManageUnmappedLeftRows && !isLeft)
myTakeCareOfUnmatachedLeftRows(mr, false); myTakeCareOfUnmatachedLeftRows(mr, false);
} }
otherIDToResultRows[mrID].Add(rr.Id(), rr); otherIDToResultRows[mrID].Add((int)rr["id"], rr);
} }
} }
else else
@@ -351,22 +458,22 @@ namespace BCG
otherIDToResultRows = isLeft ? myRightIDToResultRows : myLeftIDToResultRows; otherIDToResultRows = isLeft ? myRightIDToResultRows : myLeftIDToResultRows;
foreach (IBlueRow r in deletedRows) foreach (IBlueRow r in deletedRows)
{ {
int id = r.Id(); int id = (int)r["id"];
object key = ExceptionAssert.NotNull(r[thisKeyCol]); object key = r[thisKeyCol];
///delete it from 1. ///delete it from 1.
thisKeyToRows[key].Remove(id); thisKeyToRows[key].Remove(id);
if (thisKeyToRows[key].Count == 0) if (thisKeyToRows[key].Count == 0)
thisKeyToRows.Remove(key); thisKeyToRows.Remove(key);
///form return rows and delete from 3. ///form return rows and delete from 3.
if (thisIDToResultRows.TryGetValue(id, out IDictionary<int, SuperJoinRow>? removedResultRowMap)) if (thisIDToResultRows.ContainsKey(id))
{ {
var removedResultRows = (ICollection)removedResultRowMap.Values; ICollection removedResultRows = thisIDToResultRows[id].Values as ICollection;
thisIDToResultRows.Remove(id); thisIDToResultRows.Remove(id);
foreach (SuperJoinRow rr in removedResultRows) foreach (SuperJoinRow rr in removedResultRows)
{ {
///delete from 4. ///delete from 4.
int otherId = isLeft ? rr.rightID : rr.leftID; int otherId = isLeft ? rr.rightID : rr.leftID;
otherIDToResultRows[otherId].Remove(rr.Id()); otherIDToResultRows[otherId].Remove((int)rr["id"]);
if (otherIDToResultRows[otherId].Count == 0) if (otherIDToResultRows[otherId].Count == 0)
otherIDToResultRows.Remove(otherId); otherIDToResultRows.Remove(otherId);
delRowsOut.addRow(rr); delRowsOut.addRow(rr);
@@ -386,7 +493,7 @@ namespace BCG
private void myTakeCareOfUnmatachedLeftRows(IBlueRow leftRow, bool add) private void myTakeCareOfUnmatachedLeftRows(IBlueRow leftRow, bool add)
{ {
int lid = leftRow.Id(); int lid = (int)leftRow["id"];
if (add) if (add)
myLeftUnmatchedRowsAdds.Add(lid, leftRow); myLeftUnmatchedRowsAdds.Add(lid, leftRow);
else else
@@ -394,7 +501,7 @@ namespace BCG
if (myLeftUnmatchedRowsAdds.ContainsKey(lid)) if (myLeftUnmatchedRowsAdds.ContainsKey(lid))
myLeftUnmatchedRowsAdds.Remove(lid); myLeftUnmatchedRowsAdds.Remove(lid);
else else
myLeftUnmatchedRowsDels.Add(lid, leftRow); myLeftUnmatchedRowsDels.Add((int)leftRow["id"], leftRow);
} }
} }
} }
@@ -415,49 +522,44 @@ namespace BCG
protected override void myFireEvent(object o) protected override void myFireEvent(object o)
{ {
myHandleJoinResults(myLeftUnmatchedRowsDels, myLeftUnmatchedRowsAdds, (IDataPacket)o); myHandleJoinResults(myLeftUnmatchedRowsDels, myLeftUnmatchedRowsAdds, o as DataPacket);
} }
void myHandleJoinResults(Dictionary<int, IBlueRow> unmatchedLeftRowsDels, Dictionary<int, IBlueRow> unmatchedLeftRowAdds, IDataPacket resultPacket) { private void myHandleJoinResults(Dictionary<int, IBlueRow> unmatchedLeftRowsDels,
ExceptionAssert.NotNull(myJoinProjectHelper); Dictionary<int, IBlueRow> unmatchedLeftRowAdds, DataPacket resultPacket)
var dels = resultPacket.deletedRows; {
var adds = resultPacket.addedRows; BlueTable dels = resultPacket.deletedRows as BlueTable,
adds = resultPacket.addedRows as BlueTable;
if (unmatchedLeftRowsDels.Count > 0) { foreach (IBlueRow lr in unmatchedLeftRowsDels.Values)
ExceptionAssert.NotNull(myState); {
var mutableDels = (BlueTable)dels; ///an lr will be here if its actually deleted or
foreach (IBlueRow lr in unmatchedLeftRowsDels.Values) { ///a right row is added, so now it has a partner
///an lr will be here if its actually deleted or ///and is no longer unmatched.
///a right row is added, so now it has a partner ///in both cases the half row that this lr
///and is no longer unmatched. ///created needs to be removed from this
///in both cases the half row that this lr ///class's state and added to dels
///created needs to be removed from this ///it means a right is added
///class's state and added to dels int lid = (int)lr["id"];
///it means a right is added SuperJoinRow rr = myLeftIDToHalfRows[lid];
int lid = lr.Id(); myLeftIDToHalfRows.Remove(lid);
SuperJoinRow rr = myLeftIDToHalfRows[lid]; myState.deleteRow(rr);
myLeftIDToHalfRows.Remove(lid); dels.addRow(rr);
myState.deleteRow(rr);
mutableDels.addRow(rr);
}
} }
if (unmatchedLeftRowAdds.Count > 0) { foreach (IBlueRow lr in unmatchedLeftRowAdds.Values)
ExceptionAssert.NotNull(myState); {
var mutableAdds = (BlueTable)adds; ///an lr will be here if its added with no
foreach (IBlueRow lr in unmatchedLeftRowAdds.Values) { ///matching right, or a right matching row
///an lr will be here if its added with no ///is gone so it is unmatched now.
///matching right, or a right matching row ///in both cases a half row needs to be
///is gone so it is unmatched now. ///added to this class's state and added
///in both cases a half row needs to be ///to adds
///added to this class's state and added int lid = (int)lr["id"];
///to adds SuperJoinRow rr = new SuperJoinRow(myID++, lr, null, myJoinProjectHelper);
int lid = lr.Id(); myLeftIDToHalfRows.Add(lid, rr);
SuperJoinRow rr = new SuperJoinRow(myID++, lr, null, myJoinProjectHelper); myState.addRow(rr);
myLeftIDToHalfRows.Add(lid, rr); adds.addRow(rr);
myState.addRow(rr);
mutableAdds.addRow(rr);
}
} }
base.myFireEvent(new DataPacket(myState, adds, dels)); base.myFireEvent(new DataPacket(myState, adds, dels));
} }
@@ -1,4 +1,6 @@
namespace BCG { namespace BCG {
using System.Collections.Generic;
public class KeyValueToRelationalStream : ViewStream { public class KeyValueToRelationalStream : ViewStream {
private readonly ViewStream _kv_str; private readonly ViewStream _kv_str;
private readonly string _doc_id_col, _key_col, _val_col; private readonly string _doc_id_col, _key_col, _val_col;
@@ -18,7 +20,7 @@ namespace BCG {
} }
private void _on_str_update(object dp_obj) { private void _on_str_update(object dp_obj) {
var dp = (IDataPacket)dp_obj; DataPacket dp = dp_obj as DataPacket;
var rows = dp.newRows; var rows = dp.newRows;
var rv = BlueDataUtility.keyvalue_to_relational<string>(rows, _doc_id_col, _key_col, _val_col); var rv = BlueDataUtility.keyvalue_to_relational<string>(rows, _doc_id_col, _key_col, _val_col);
var dp_out = BlueDataUtility.build_dp_inc(rv, myLastValue as DataPacket, true); var dp_out = BlueDataUtility.build_dp_inc(rv, myLastValue as DataPacket, true);
@@ -26,4 +28,4 @@ namespace BCG {
} }
} }
} }
@@ -1,9 +1,6 @@
using Bts.DataStreamCore;
using Spark.Core.Diagnostics;
using System; using System;
using System.Collections.Generic; using System.Collections;
using BCG.Utilities;
namespace BCG namespace BCG
{ {
@@ -14,11 +11,9 @@ namespace BCG
[DataStreamUserRespresentation (false)] [DataStreamUserRespresentation (false)]
public class LeftInternalJoinStream : InternalJoinStream public class LeftInternalJoinStream : InternalJoinStream
{ {
protected IDataPacket? myLeftDataPacket; protected DataPacket myLeftDataPacket, myRightDataPacket;
protected IDataPacket? myRightDataPacket;
//Container to contain all the left rows that are orphaned during a deletion operation //Container to contain all the left rows that are orphaned during a deletion operation
Dictionary<int, RowNode>? myLeftOrphanedRows; private IDictionary myLeftOrphanedRows;
public LeftInternalJoinStream (ViewStream vsLeft, string jcLeft, ViewStream vsRight, string jcRight) : public LeftInternalJoinStream (ViewStream vsLeft, string jcLeft, ViewStream vsRight, string jcRight) :
base (vsLeft, jcLeft, vsRight, jcRight) {} base (vsLeft, jcLeft, vsRight, jcRight) {}
@@ -67,9 +62,7 @@ namespace BCG
private void myTestAndFire (bool isLeft) private void myTestAndFire (bool isLeft)
{ {
JoinOperand jo = isLeft ? myLeftOperand : myRightOperand; JoinOperand jo = isLeft ? myLeftOperand : myRightOperand;
var dp = isLeft DataPacket dp = isLeft ? myLeftDataPacket : myRightDataPacket;
? ExceptionAssert.NotNull(myLeftDataPacket)
: ExceptionAssert.NotNull(myRightDataPacket);
//to test whether both have received call backs //to test whether both have received call backs
if (myLeftOperand.hasReceivedData) if (myLeftOperand.hasReceivedData)
jo.changeHandler (dp); jo.changeHandler (dp);
@@ -87,13 +80,11 @@ namespace BCG
/// <param name="isLeft"></param> /// <param name="isLeft"></param>
public override void addRows (IBlueRowCollection rows, bool isLeft) public override void addRows (IBlueRowCollection rows, bool isLeft)
{ {
ExceptionAssert.NotNull(myLastFiredPacket);
foreach (IBlueRow row in rows) foreach (IBlueRow row in rows)
myAddRow (row, isLeft); myAddRow (row, isLeft);
if (!isLeft) if (!isLeft)
foreach (RowNode node in ExceptionAssert.NotNull(myLeftOrphanedRows).Values) { foreach (RowNode node in myLeftOrphanedRows.Values)
((JoinTable)myLastFiredPacket.newRows).addRow(node.RequireRow(), null, myLastFiredPacket); ((JoinTable)myLastFiredPacket.newRows).addRow (node.row, null, myLastFiredPacket);
}
} }
/// <summary> /// <summary>
@@ -103,19 +94,17 @@ namespace BCG
/// <param name="isLeft"></param> /// <param name="isLeft"></param>
public override void deleteRows (IBlueRowCollection rows, bool isLeft) public override void deleteRows (IBlueRowCollection rows, bool isLeft)
{ {
myLeftOrphanedRows = new(); myLeftOrphanedRows = new Hashtable ();
foreach (IBlueRow row in rows) foreach (IBlueRow row in rows)
myDeleteRow (row, isLeft); myDeleteRow (row, isLeft);
} }
private void myAddRow (IBlueRow row, bool isLeft) private void myAddRow (IBlueRow row, bool isLeft)
{ {
ExceptionAssert.NotNull(myLastFiredPacket);
if (isLeft) if (isLeft)
{ {
myLeftOperand.addRow (row); myLeftOperand.addRow (row);
var joinKey = ExceptionAssert.NotNull(row[myLeftJoinColOrdinal]); RowList matchedRows = myRightOperand.getMatchingRows (row[myLeftJoinColOrdinal]);
RowList matchedRows = myRightOperand.getMatchingRows(joinKey);
if (matchedRows.Count == 0) if (matchedRows.Count == 0)
((JoinTable)myLastFiredPacket.newRows).addRow (row, null, myLastFiredPacket); ((JoinTable)myLastFiredPacket.newRows).addRow (row, null, myLastFiredPacket);
else else
@@ -124,25 +113,22 @@ namespace BCG
} }
else else
{ {
var joinKey = ExceptionAssert.NotNull(row[myRightJoinColOrdinal]); RowList matchedRows = myLeftOperand.getMatchingRows (row[myRightJoinColOrdinal]);
RowList matchedRows = myLeftOperand.getMatchingRows(joinKey); int rightMatchingRowCount = myRightOperand.getMatchingRows (row[myRightJoinColOrdinal]).Count;
int rightMatchingRowCount = myRightOperand.getMatchingRows(joinKey).Count;
myRightOperand.addRow (row); myRightOperand.addRow (row);
int newRightMatchingRowCount = myRightOperand.getMatchingRows(joinKey).Count; int newRightMatchingRowCount = myRightOperand.getMatchingRows (row[myRightJoinColOrdinal]).Count;
if (matchedRows.Count != 0){ if (matchedRows.Count != 0){
foreach (RowNode matchedNode in matchedRows) foreach (RowNode matchedNode in matchedRows)
{ {
ExceptionAssert.NotNull(matchedNode.row);
//if the left rows were orphaned in this transaction (ie in this callback), they should //if the left rows were orphaned in this transaction (ie in this callback), they should
//just be removed from the orphanedlist and we dont need to worry about the consistency of //just be removed from the orphanedlist and we dont need to worry about the consistency of
//the jointable as a new row will replace it //the jointable as a new row will replace it
if (rightMatchingRowCount == 0 && newRightMatchingRowCount > 0) if (rightMatchingRowCount == 0 && newRightMatchingRowCount > 0)
{ {
ExceptionAssert.NotNull(myLeftOrphanedRows); if (myLeftOrphanedRows[matchedNode.row["id"]] == null)
int matchedId = matchedNode.row.Id(); ((JoinTable)myLastFiredPacket.newRows).deleteRow (true, matchedNode.row, myLastFiredPacket);
if (!myLeftOrphanedRows.Remove(matchedId)) { else
((JoinTable)myLastFiredPacket.newRows).deleteRow(true, matchedNode.row, myLastFiredPacket); myLeftOrphanedRows.Remove (matchedNode.row["id"]);
}
} }
//they were orphaned by a previous transaction and hence the orphans need to be //they were orphaned by a previous transaction and hence the orphans need to be
//removed from the Jointable and the complete row added //removed from the Jointable and the complete row added
@@ -155,52 +141,41 @@ namespace BCG
private void myDeleteRow (IBlueRow row, bool isLeft) private void myDeleteRow (IBlueRow row, bool isLeft)
{ {
var last = requireLastFiredPacket();
if (isLeft) if (isLeft)
{ {
myLeftOperand.deleteRow (row); myLeftOperand.deleteRow (row);
((JoinTable)last.newRows).deleteRow (true, row, myLastFiredPacket); ((JoinTable)myLastFiredPacket.newRows).deleteRow (true, row, myLastFiredPacket);
} }
else else
{ {
var rightJoinKey = row[myRightJoinColOrdinal] ?? throw new InvalidOperationException("RightJoinKey is null"); RowList matchedRows = myLeftOperand.getMatchingRows (row[myRightJoinColOrdinal]);
RowList matchedRows = myLeftOperand.getMatchingRows(rightJoinKey); int rightMatchingRowCount = myRightOperand.getMatchingRows (row[myRightJoinColOrdinal]).Count;
int rightMatchingRowCount = myRightOperand.getMatchingRows(rightJoinKey).Count;
myRightOperand.deleteRow (row); myRightOperand.deleteRow (row);
int newRightMatchingRowCount = myRightOperand.getMatchingRows(rightJoinKey).Count; int newRightMatchingRowCount = myRightOperand.getMatchingRows (row[myRightJoinColOrdinal]).Count;
if (matchedRows.Count != 0) if (matchedRows.Count != 0)
{ {
if (rightMatchingRowCount > 0 && newRightMatchingRowCount == 0) { if (rightMatchingRowCount > 0 && newRightMatchingRowCount == 0)
ExceptionAssert.MemberNotNull(myLeftOrphanedRows);
//ie all the matchedRows were joined with 'this' right row (method arg), and hence they need to //ie all the matchedRows were joined with 'this' right row (method arg), and hence they need to
//be handled specially, ie joined with nulls, if there are no right rows with this //be handled specially, ie joined with nulls, if there are no right rows with this
//joincolumn value being inserted. //joincolumn value being inserted.
ExceptionAssert.NotNull(myLeftOrphanedRows);
foreach (RowNode matchedNode in matchedRows) foreach (RowNode matchedNode in matchedRows)
{ {
// BlueEventLog.logAssert (myLeftOrphanedRows[matchedNode.row["id"]] == null); // BlueEventLog.logAssert (myLeftOrphanedRows[matchedNode.row["id"]] == null);
myLeftOrphanedRows[matchedNode.row.Id()] = matchedNode; myLeftOrphanedRows[matchedNode.row["id"]] = matchedNode;
} }
} ((JoinTable)myLastFiredPacket.newRows).deleteRow (false, row, myLastFiredPacket);
((JoinTable)last.newRows).deleteRow (false, row, myLastFiredPacket);
} }
} }
} }
public override void onTableClear (bool isLeft) public override void onTableClear (bool isLeft)
{ {
if (myLastFiredPacket is null) {
return;
}
requireSchema();
myLastFiredPacket.deletedRows = myLastFiredPacket.newRows; myLastFiredPacket.deletedRows = myLastFiredPacket.newRows;
myLastFiredPacket.newRows = new JoinTable (mySchema); myLastFiredPacket.newRows = new JoinTable (mySchema);
myLastFiredPacket.addedRows = new BlueTable (mySchema); myLastFiredPacket.addedRows = new BlueTable (mySchema);
if (!isLeft) { if (!isLeft)
ExceptionAssert.MemberNotNull(myLeftDataPacket);
foreach (IBlueRow row in myLeftDataPacket.newRows) foreach (IBlueRow row in myLeftDataPacket.newRows)
((JoinTable)myLastFiredPacket.newRows).addRow (row, null, myLastFiredPacket); ((JoinTable)myLastFiredPacket.newRows).addRow (row, null, myLastFiredPacket);
}
} }
} }
@@ -30,7 +30,7 @@ namespace BCG
/// <summary> /// <summary>
/// Node containing the referencedRow /// Node containing the referencedRow
/// </summary> /// </summary>
IBlueRow? referencedRow { get; } IBlueRow referencedRow {get;}
/// <summary> /// <summary>
/// removes all referenced or referencing nodes (indicated by the bool), p.s. theres only one referenced row /// removes all referenced or referencing nodes (indicated by the bool), p.s. theres only one referenced row
@@ -15,14 +15,12 @@ namespace BCG
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
IBlueRow? getRow(int id); IBlueRow getRow (int id);
/// <summary> /// <summary>
/// Gets all the rows in the node /// Gets all the rows in the node
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
IBlueRow?[] getRows(); IBlueRow[] getRows ();
/// <summary> /// <summary>
/// Replaces the row with the given id, with the row passed as the second arg /// Replaces the row with the given id, with the row passed as the second arg
/// </summary> /// </summary>
@@ -1,5 +1,7 @@
using System; using System;
using System.Collections; using System.Collections;
using BCG.Utilities;
using BCG;
namespace BCG namespace BCG
{ {
@@ -54,18 +56,13 @@ namespace BCG
/// The key can either be the string corrsponding to the column name or /// The key can either be the string corrsponding to the column name or
/// the order of the column /// the order of the column
/// </summary> /// </summary>
public virtual object? this [object key] public virtual object this [object key]
{ {
// get {return key is string ? this [key as string] : this [(int)key];} get {return key is string ? this [key as string] : this [(int)key];}
get => key switch {
string colName => this[colName],
int colIndex => this[colIndex],
_ => throw new ArgumentException("Must be string or int", nameof(key)),
};
set {throw new NotSupportedException ("The IBlueRow is read only");} set {throw new NotSupportedException ("The IBlueRow is read only");}
} }
public virtual object? this [int index] public virtual object this [int index]
{ {
get get
{ {
@@ -80,8 +77,7 @@ namespace BCG
} }
} }
public object? this [string colName] => public object this [string colName] {get{return this[mySchema[colName].colNo];}}
this[mySchema[colName].colNo];
public ICollection Keys{get{return mySchema.columnNames;}} public ICollection Keys{get{return mySchema.columnNames;}}
@@ -1,6 +1,6 @@
using Spark.Core.Diagnostics; using System;
using System.Collections; using System.Collections;
using BCG.Utilities;
namespace BCG namespace BCG
{ {
@@ -70,8 +70,7 @@ namespace BCG
} }
else else
{ {
var sn = (SimpleNode)n; SimpleNode sn = n as SimpleNode;
ExceptionAssert.NotNull(sn.prev);
sn.prev.next = sn.next; sn.prev.next = sn.next;
if (sn.next != null) if (sn.next != null)
sn.next.prev = sn.prev; sn.next.prev = sn.prev;
@@ -82,7 +81,7 @@ namespace BCG
public int count {get {return myFirst.listCount;}} public int count {get {return myFirst.listCount;}}
public IBlueRow? referencedRow => myFirst.row; public IBlueRow referencedRow {get {return myFirst.row;}}
public void removeAll (bool isReD) public void removeAll (bool isReD)
{ {
@@ -111,11 +110,10 @@ namespace BCG
public class LightForeignJoinRowListEnumerator : IEnumerator public class LightForeignJoinRowListEnumerator : IEnumerator
{ {
private ILightForeignJoinRowList myList; private ILightForeignJoinRowList myList;
private SimpleNode? myPtr; private SimpleNode myPtr, myFirst;
private SimpleNode myFirst;
public LightForeignJoinRowListEnumerator (ILightForeignJoinRowList list, SimpleNode first) public LightForeignJoinRowListEnumerator (ILightForeignJoinRowList list, SimpleNode first)
{myList = list; myFirst = first;} {myList = list; myFirst = first;}
public object? Current => myPtr?.row; public object Current {get{return myPtr.row;}}
public bool MoveNext() {return (myPtr = myPtr == null ? myFirst : myPtr.next) != null;} public bool MoveNext() {return (myPtr = myPtr == null ? myFirst : myPtr.next) != null;}
public void Reset() {myPtr = null;} public void Reset() {myPtr = null;}
public ILightForeignJoinRowList list {get {return myList;}} public ILightForeignJoinRowList list {get {return myList;}}
Loaded 100 of 1417 files, more files were not shown because too many files have changed in this diff. Show more