ClickHouse/programs/library-bridge
Robert Schulze 20bb8a248e
Prepare server-side BridgeHelper for catboost integration
Wall of text, sorry, but I also had to document some stuff for myself:

There are three ways to communicate data using HTTP:
- the HTTP verb: for our purposes, PUT and GET,
- the HTTP path: '/ping', '/request' etc.,
- the HTTP URL parameter(s), e.g. 'method=libNew&dictionary_id=1234'

The bridge will use different handlers for communication with the
external dictionary library and for communication with the catboost
library. Handlers are created based on a combination of the HTTP verb
and the HTTP method. More specifically, there will be combinations
- GET + '/extdict_ping'
- PUT + '/extdict_request'
- GET + '/catboost_ping'
- PUT + '/catboost_request'.
For each combination, the bridge expects a certain set of URL
parameters, e.g. for the first combination parameter "dictionary_id" is
expected.

Starting with this commit, the library-bridge creates handlers based on
the first two combinations (the latter two combinations will be added
later). This makes the handler creation mechanism consistent with it's
counterpart in xdbc-bridge.

For that, it was necessary to make both IBridgeHelper methods
"getMainURI()" and "getPingURI()" pure virtual so that derived classes
(LibraryBridgeHelper and XDBCBridgeHelper) must provide custom URLs with
custom paths.

Side note 1: Previously, LibraryBridgeHelper sent HTTP URL parameter
"method=ping" during handshake (PING) but the library-bridge ignored
that parameter. We now omit this parameter, i.e.
LibraryBridgeHelper::PING was removed. Again, this makes things
consistent with xdbc-bridge.

Side note 2: xdbc-bridge is unchanged in this commit. Therefore,
XDBCBridgeHelper now uses the HTTP paths previously in the base class.
For funny reason, XDBCBridgeHelper did not use
IBridgeHelper::getMainURI() - it generates the URLs by itself. I kept it
that way for now but provided an implementation of getMainURI() anyways.
2022-08-04 19:29:51 +00:00
..
CMakeLists.txt Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
ExternalDictionaryLibraryAPI.cpp Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
ExternalDictionaryLibraryAPI.h Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
ExternalDictionaryLibraryHandler.cpp Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
ExternalDictionaryLibraryHandler.h Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
ExternalDictionaryLibraryHandlerFactory.cpp Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
ExternalDictionaryLibraryHandlerFactory.h Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
ExternalDictionaryLibraryUtils.h Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
library-bridge.cpp Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
LibraryBridge.cpp Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
LibraryBridge.h Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
LibraryBridgeHandlerFactory.cpp Prepare server-side BridgeHelper for catboost integration 2022-08-04 19:29:51 +00:00
LibraryBridgeHandlerFactory.h Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
LibraryBridgeHandlers.cpp Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00
LibraryBridgeHandlers.h Prepare library-bridge for catboost integration 2022-08-04 19:26:51 +00:00