Module for binding instance.
| 36 | |
| 37 | /** Module for binding instance. */ |
| 38 | public class TrinoModule implements Module { |
| 39 | private Map<String, String> config; |
| 40 | |
| 41 | public TrinoModule(Map<String, String> config) { |
| 42 | this.config = config; |
| 43 | } |
| 44 | |
| 45 | @Override |
| 46 | public void configure(Binder binder) { |
| 47 | binder.bind(Options.class).toInstance(new Options(config)); |
| 48 | binder.bind(TrinoMetadataFactory.class).in(SINGLETON); |
| 49 | binder.bind(TrinoSplitManager.class).in(SINGLETON); |
| 50 | binder.bind(TrinoPageSourceProvider.class).in(SINGLETON); |
| 51 | binder.bind(TrinoPageSinkProvider.class).in(SINGLETON); |
| 52 | binder.bind(TrinoNodePartitioningProvider.class).in(SINGLETON); |
| 53 | binder.bind(TrinoSessionProperties.class).in(SINGLETON); |
| 54 | binder.bind(TrinoTableOptions.class).in(SINGLETON); |
| 55 | newSetBinder(binder, ConnectorTableFunction.class) |
| 56 | .addBinding() |
| 57 | .toProvider(TableChangesFunctionProvider.class) |
| 58 | .in(Scopes.SINGLETON); |
| 59 | binder.bind(FunctionProvider.class).to(TrinoFunctionProvider.class).in(Scopes.SINGLETON); |
| 60 | binder.bind(TableChangesFunctionProcessorProvider.class).in(SINGLETON); |
| 61 | } |
| 62 | } |
nothing calls this directly
no outgoing calls
no test coverage detected