@Test public void testBackwardCompatible() { Assert.assertEquals(PluginManager .loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.realtime.stream.SimpleAvroMessageDecoder"), "org.apache.pinot.plugin.inputformat.avro.SimpleAvroMessageDecoder"); Assert.assertEquals(PluginManager .loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.realtime.stream.SimpleAvroMessageDecoder"), "org.apache.pinot.plugin.inputformat.avro.SimpleAvroMessageDecoder"); Assert.assertEquals(PluginManager .loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.realtime.impl.kafka.KafkaAvroMessageDecoder"), "org.apache.pinot.plugin.inputformat.avro.KafkaAvroMessageDecoder"); Assert.assertEquals(PluginManager .loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.realtime.impl.kafka.KafkaJSONMessageDecoder"), "org.apache.pinot.plugin.stream.kafka.KafkaJSONMessageDecoder"); Assert.assertEquals( PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.data.readers.AvroRecordReader"), "org.apache.pinot.plugin.inputformat.avro.AvroRecordReader"); Assert.assertEquals( PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.data.readers.CSVRecordReader"), "org.apache.pinot.plugin.inputformat.csv.CSVRecordReader"); Assert.assertEquals( PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.data.readers.JSONRecordReader"), "org.apache.pinot.plugin.inputformat.json.JSONRecordReader"); Assert.assertEquals( PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.orc.data.readers.ORCRecordReader"), "org.apache.pinot.plugin.inputformat.orc.ORCRecordReader"); Assert.assertEquals( PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.parquet.data.readers.ParquetRecordReader"), "org.apache.pinot.plugin.inputformat.parquet.ParquetRecordReader"); Assert.assertEquals( PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.data.readers.ThriftRecordReader"), "org.apache.pinot.plugin.inputformat.thrift.ThriftRecordReader"); Assert.assertEquals(PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.filesystem.AzurePinotFS"), "org.apache.pinot.plugin.filesystem.AzurePinotFS"); Assert.assertEquals(PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.filesystem.HadoopPinotFS"), "org.apache.pinot.plugin.filesystem.HadoopPinotFS"); Assert.assertEquals(PluginManager.loadClassWithBackwardCompatibleCheck("org.apache.pinot.filesystem.LocalPinotFS"), "org.apache.pinot.spi.filesystem.LocalPinotFS"); Assert.assertEquals(PluginManager .loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.realtime.impl.kafka.KafkaConsumerFactory"), "org.apache.pinot.plugin.stream.kafka09.KafkaConsumerFactory"); Assert.assertEquals(PluginManager .loadClassWithBackwardCompatibleCheck("org.apache.pinot.core.realtime.impl.kafka2.KafkaConsumerFactory"), "org.apache.pinot.plugin.stream.kafka20.KafkaConsumerFactory"); }
public static String loadClassWithBackwardCompatibleCheck(String className) { return PLUGINS_BACKWARD_COMPATIBLE_CLASS_NAME_MAP.getOrDefault(className, className); }
PluginManager { public static String loadClassWithBackwardCompatibleCheck(String className) { return PLUGINS_BACKWARD_COMPATIBLE_CLASS_NAME_MAP.getOrDefault(className, className); } }
PluginManager { public static String loadClassWithBackwardCompatibleCheck(String className) { return PLUGINS_BACKWARD_COMPATIBLE_CLASS_NAME_MAP.getOrDefault(className, className); } private  PluginManager(); }
PluginManager { public static String loadClassWithBackwardCompatibleCheck(String className) { return PLUGINS_BACKWARD_COMPATIBLE_CLASS_NAME_MAP.getOrDefault(className, className); } private  PluginManager(); synchronized void init(); void load(String pluginName, File directory); Class<?> loadClass(String className); Class<?> loadClass(String pluginName, String className); static String loadClassWithBackwardCompatibleCheck(String className); T createInstance(String className); T createInstance(String className, Class[] argTypes, Object[] argValues); T createInstance(String pluginName, String className); T createInstance(String pluginName, String className, Class[] argTypes, Object[] argValues); String getPluginsRootDir(); static PluginManager get(); }
PluginManager { public static String loadClassWithBackwardCompatibleCheck(String className) { return PLUGINS_BACKWARD_COMPATIBLE_CLASS_NAME_MAP.getOrDefault(className, className); } private  PluginManager(); synchronized void init(); void load(String pluginName, File directory); Class<?> loadClass(String className); Class<?> loadClass(String pluginName, String className); static String loadClassWithBackwardCompatibleCheck(String className); T createInstance(String className); T createInstance(String className, Class[] argTypes, Object[] argValues); T createInstance(String pluginName, String className); T createInstance(String pluginName, String className, Class[] argTypes, Object[] argValues); String getPluginsRootDir(); static PluginManager get(); static final String PLUGINS_DIR_PROPERTY_NAME; static final String PLUGINS_INCLUDE_PROPERTY_NAME; static final String DEFAULT_PLUGIN_NAME; }