You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/12/10 20:24:08 UTC

[GitHub] [incubator-pinot] kishoreg opened a new issue #4906: Move all interfaces to pinot-spi

kishoreg opened a new issue #4906: Move all interfaces to pinot-spi
URL: https://github.com/apache/incubator-pinot/issues/4906
 
 
   I looked at all the places we use Class.forName in Pinot. The following interfaces should be moved out to spi.
   - AccessControlFactory //security 
   - VirtualColumnProviderFactory //Uber might need this for upsert
   - MetadataExtractor //not sure who needs this
   - TransformFunction, AggregateFunction etc //make it easy to plugin udf's?
   - InstanceDataManager //dont see a use case for this
   - MetricsRegistryRegistrationListener //what does this do?
   - MetadataEventNotifierFactory //no idea what this is for
   
   At least, we should replace the Class.forName with PluginManager.createInstance(). This will allow us to make it easier to support plug-ins for these interfaces. 
   
   Thoughts?
   
   ```
   ~/projects/incubator-pinot (master) $ grep Class.forName `find . -name *.java | grep -v thirdeye`
   ./pinot-broker/src/main/java/org/apache/pinot/broker/broker/AccessControlFactory.java:      accessControlFactory = (AccessControlFactory) Class.forName(accessControlFactoryClassName).newInstance();
   ./pinot-core/src/main/java/org/apache/pinot/core/segment/virtualcolumn/VirtualColumnProviderFactory.java:      return (VirtualColumnProvider) Class.forName(virtualColumnProvider).newInstance();
   ./pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QuerySchedulerFactory.java:          Class.forName(className).getDeclaredConstructor(Configuration.class, QueryExecutor.class);
   ./pinot-core/src/main/java/org/apache/pinot/core/metadata/MetadataExtractorFactory.java:      MetadataExtractor metadataExtractor = (MetadataExtractor) Class.forName(metadataExtractorClassName).newInstance();
   ./pinot-server/src/main/java/org/apache/pinot/server/starter/ServerBuilder.java:        transformFunctionClass = (Class<TransformFunction>) Class.forName(transformFunctionClassName);
   ./pinot-server/src/main/java/org/apache/pinot/server/starter/ServerBuilder.java:    InstanceDataManager instanceDataManager = (InstanceDataManager) Class.forName(className).newInstance();
   ./pinot-server/src/main/java/org/apache/pinot/server/starter/ServerBuilder.java:    QueryExecutor queryExecutor = (QueryExecutor) Class.forName(className).newInstance();
   ./pinot-batch-ingestion/pinot-hadoop/src/main/java/org/apache/pinot/hadoop/io/JsonPinotOutputFormat.java:        return (Class<T>) Class.forName(JsonPinotOutputFormat.getJsonReaderClass(conf));
   ./pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/FlakyConsumerRealtimeClusterIntegrationTest.java:        final Constructor constructor = Class.forName(KafkaStarterUtils.KAFKA_STREAM_LEVEL_CONSUMER_CLASS_NAME)
   ./pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTest.java:    Class.forName("org.h2.Driver");
   ./pinot-tools/src/main/java/org/apache/pinot/tools/streams/MeetupRsvpStream.java:          (StreamMessageDecoder) Class.forName(KafkaStarterUtils.KAFKA_JSON_MESSAGE_DECODER_CLASS_NAME).newInstance();
   ./pinot-common/src/main/java/org/apache/pinot/common/metrics/MetricsHelper.java:              (Class<? extends MetricsRegistryRegistrationListener>) Class.forName(listenerClassName);
   ./pinot-common/src/main/java/org/apache/pinot/common/segment/fetcher/SegmentFetcherFactory.java:      SegmentFetcher segmentFetcher = (SegmentFetcher) Class.forName(fetcherClass).newInstance();
   ./pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java:      accessControlFactory = (AccessControlFactory) Class.forName(accessControlFactoryClass).newInstance();
   ./pinot-controller/src/main/java/org/apache/pinot/controller/api/events/MetadataEventNotifierFactory.java:          (MetadataEventNotifierFactory) Class.forName(metadataEventNotifierClassName).newInstance();
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org