Hi, How would I go about creating a custom filesys...
# troubleshooting
y
Hi, How would I go about creating a custom filesystem plugin ?
k
Hi @Yash Agarwal - you should be able to fork the pinot repo from https://github.com/apache/incubator-pinot, then add your own plugin directory at
<repo>/pinot-plugins/pinot-file-system/<your plugin>
. It would automatically get picked up if it’s located in the
plugins/
directory inside of a Pinot distribution.
You’d add your plugin module name to the list of modules in the
…/pinot-file-system/pom.xml
file so it gets built. I believe it’s also possible to code this up completely separate from the Pinot project, but I haven’t tried that (ie just a regular project with appropriate dependencies on Pinot jars)
And at the code level, you’re implementing a class that extends
PinotFS
.
y
yeah. I was hoping if it could be a separate code. We already our working on the way you mentioned. Thanks!
Btw
Copy code
-Dplugins.dir=/opt/pinot/plugins
we provide this path in our docker image for picking plugins but I get exceptions when loading plugins.
k
@Yash Agarwal - what exceptions? And for regular plugins, or your custom plugin?
v
Just wanted to add: we've succesfully wrote our own plugin for realtime ingestion, dont hesitate if you hit a wall
y
We get the following exception when starting our pinot nodes. with config
-Dplugins.dir=/opt/pinot/plugins
.
Copy code
Failed to load plugin [pinot-hdfs] from dir [/opt/pinot/plugins/pinot-file-system/pinot-hdfs]
java.lang.IllegalArgumentException: object is not an instance of declaring class
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.apache.pinot.spi.plugin.PluginClassLoader.<init>(PluginClassLoader.java:50) ~[pinot-all-0.7.0-SNAPSHOT-jar-with-dependencies.jar:0.7.0-SNAPSHOT-85cf696be3decb75fd8e0d9e5ec5ef0a32d8dd9b]
	at org.apache.pinot.spi.plugin.PluginManager.createClassLoader(PluginManager.java:171) ~[pinot-all-0.7.0-SNAPSHOT-jar-with-dependencies.jar:0.7.0-SNAPSHOT-85cf696be3decb75fd8e0d9e5ec5ef0a32d8dd9b]
	at org.apache.pinot.spi.plugin.PluginManager.load(PluginManager.java:162) ~[pinot-all-0.7.0-SNAPSHOT-jar-with-dependencies.jar:0.7.0-SNAPSHOT-85cf696be3decb75fd8e0d9e5ec5ef0a32d8dd9b]
	at org.apache.pinot.spi.plugin.PluginManager.init(PluginManager.java:137) ~[pinot-all-0.7.0-SNAPSHOT-jar-with-dependencies.jar:0.7.0-SNAPSHOT-85cf696be3decb75fd8e0d9e5ec5ef0a32d8dd9b]
	at org.apache.pinot.spi.plugin.PluginManager.init(PluginManager.java:103) ~[pinot-all-0.7.0-SNAPSHOT-jar-with-dependencies.jar:0.7.0-SNAPSHOT-85cf696be3decb75fd8e0d9e5ec5ef0a32d8dd9b]
	at org.apache.pinot.spi.plugin.PluginManager.<init>(PluginManager.java:84) ~[pinot-all-0.7.0-SNAPSHOT-jar-with-dependencies.jar:0.7.0-SNAPSHOT-85cf696be3decb75fd8e0d9e5ec5ef0a32d8dd9b]
	at org.apache.pinot.spi.plugin.PluginManager.<clinit>(PluginManager.java:46) ~[pinot-all-0.7.0-SNAPSHOT-jar-with-dependencies.jar:0.7.0-SNAPSHOT-85cf696be3decb75fd8e0d9e5ec5ef0a32d8dd9b]
	at org.apache.pinot.tools.admin.PinotAdministrator.main(PinotAdministrator.java:166) ~[pinot-all-0.7.0-SNAPSHOT-jar-with-dependencies.jar:0.7.0-SNAPSHOT-85cf696be3decb75fd8e0d9e5ec5ef0a32d8dd9b]
x
hmm, is there any change ?
if it’s java 11, then you don’t need to specify this
-Dplugins.dir=/opt/pinot/plugins
we should put the jar into classpath
this classloader stuff only works on jdk8
k
@Yash Agarwal was this resolved?
y
Yes. It is working. Thanks!!