@@ -94,3 +94,62 @@ configuration variable ``catalog.config-dir``. In order for Presto to pick up
9494the new plugin, you must restart Presto.
9595
9696Plugins must be installed on all nodes in the Presto cluster (coordinator and workers).
97+
98+ Coordinator Plugin
99+ ------------------
100+
101+ The ``CoordinatorPlugin `` interface allows plugins to provide additional
102+ functionality for the Presto coordinator. Presto SPI defines different service
103+ provider factories and service providers that allow customization of session
104+ property providers, function namespace managers, type managers, expression
105+ optimizers, and plan checkers. The following service providers can be accessed
106+ via their respective provider factories.
107+
108+ +----------------------+----------------------------------------+---------------------------------+
109+ | Service | Provider Factory | Service Provider |
110+ +======================+========================================+=================================+
111+ | Session Properties | WorkerSessionPropertyProviderFactory | WorkerSessionPropertyProvider |
112+ +----------------------+----------------------------------------+---------------------------------+
113+ | Functions | FunctionNamespaceManagerFactory | FunctionNamespaceManager |
114+ +----------------------+----------------------------------------+---------------------------------+
115+ | Types | TypeManagerFactory | TypeManager |
116+ +----------------------+----------------------------------------+---------------------------------+
117+ | Expression Optimizer | ExpressionOptimizerFactory | ExpressionOptimizer |
118+ +----------------------+----------------------------------------+---------------------------------+
119+ | Plan Checker | PlanCheckerProviderFactory | PlanCheckerProvider |
120+ +----------------------+----------------------------------------+---------------------------------+
121+
122+ ``CoordinatorPlugin `` interface provides methods to access all registered
123+ provider factories that customize these services. In a Presto C++ cluster,
124+ the class ``NativeSidecarPlugin `` implements ``CoordinatorPlugin `` interface
125+ to customize functionality for Presto C++.
126+
127+ .. _native-sidecar-plugin :
128+
129+ Native Sidecar Plugin
130+ ---------------------
131+
132+ The ``NativeSidecarPlugin `` class implements ``CoordinatorPlugin `` interface
133+ and returns the following service providers via their respective provider
134+ factories.
135+
136+ +----------------------+----------------------------------------------+---------------------------------------+
137+ | Service | Native Provider Factory | Native Service Provider |
138+ +======================+==============================================+=======================================+
139+ | Session Properties | NativeSystemSessionPropertyProviderFactory | NativeSystemSessionPropertyProvider |
140+ +----------------------+----------------------------------------------+---------------------------------------+
141+ | Functions | NativeFunctionNamespaceManagerFactory | NativeFunctionNamespaceManager |
142+ +----------------------+----------------------------------------------+---------------------------------------+
143+ | Types | NativeTypeManagerFactory | NativeTypeManager |
144+ +----------------------+----------------------------------------------+---------------------------------------+
145+ | Plan Checker | NativePlanCheckerProviderFactory | NativePlanCheckerProvider |
146+ +----------------------+----------------------------------------------+---------------------------------------+
147+
148+ For instance, the class ``NativeSystemSessionPropertyProviderFactory ``
149+ implements the interface ``WorkerSessionPropertyProviderFactory `` in Presto SPI
150+ to return the service provider, ``NativeSystemSessionPropertyProvider ``. The class
151+ ``NativeSystemSessionPropertyProvider `` retrieves all session properties
152+ supported by the Presto C++ worker by making a REST call to the endpoint
153+ ``/v1/properties/session `` on the Presto C++ sidecar. ``NativeSidecarPlugin ``,
154+ therefore, needs at least one Presto C++ worker in the cluster to be configured
155+ as a sidecar. See :doc: `/presto_cpp/sidecar ` for more details.
0 commit comments