{"payload":{"allShortcutsEnabled":false,"fileTree":{"devs/docs":{"items":[{"name":"architecture.rst","path":"devs/docs/architecture.rst","contentType":"file"},{"name":"architecture.svg","path":"devs/docs/architecture.svg","contentType":"file"},{"name":"basics.rst","path":"devs/docs/basics.rst","contentType":"file"},{"name":"benchmarks.rst","path":"devs/docs/benchmarks.rst","contentType":"file"},{"name":"index.rst","path":"devs/docs/index.rst","contentType":"file"},{"name":"logging.rst","path":"devs/docs/logging.rst","contentType":"file"},{"name":"plugins.rst","path":"devs/docs/plugins.rst","contentType":"file"},{"name":"release.rst","path":"devs/docs/release.rst","contentType":"file"},{"name":"tests.rst","path":"devs/docs/tests.rst","contentType":"file"},{"name":"write_docs.rst","path":"devs/docs/write_docs.rst","contentType":"file"}],"totalCount":10},"devs":{"items":[{"name":"docs","path":"devs/docs","contentType":"directory"},{"name":"tools","path":"devs/tools","contentType":"directory"}],"totalCount":2},"":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":".idea","path":".idea","contentType":"directory"},{"name":".mvn","path":".mvn","contentType":"directory"},{"name":".vscode","path":".vscode","contentType":"directory"},{"name":"app","path":"app","contentType":"directory"},{"name":"benchmarks","path":"benchmarks","contentType":"directory"},{"name":"blackbox","path":"blackbox","contentType":"directory"},{"name":"devs","path":"devs","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"extensions","path":"extensions","contentType":"directory"},{"name":"jlink-jdk","path":"jlink-jdk","contentType":"directory"},{"name":"libs","path":"libs","contentType":"directory"},{"name":"plugins","path":"plugins","contentType":"directory"},{"name":"sandbox","path":"sandbox","contentType":"directory"},{"name":"server","path":"server","contentType":"directory"},{"name":".editorconfig","path":".editorconfig","contentType":"file"},{"name":".git-blame-ignore-revs","path":".git-blame-ignore-revs","contentType":"file"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".mailmap","path":".mailmap","contentType":"file"},{"name":".mergify.yml","path":".mergify.yml","contentType":"file"},{"name":".readthedocs.yml","path":".readthedocs.yml","contentType":"file"},{"name":".vale.ini","path":".vale.ini","contentType":"file"},{"name":"3RD-PARTY-NOTICES.md","path":"3RD-PARTY-NOTICES.md","contentType":"file"},{"name":"CODE_OF_CONDUCT.md","path":"CODE_OF_CONDUCT.md","contentType":"file"},{"name":"CONTRIBUTING.rst","path":"CONTRIBUTING.rst","contentType":"file"},{"name":"Jenkinsfile","path":"Jenkinsfile","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"NOTICE","path":"NOTICE","contentType":"file"},{"name":"README.rst","path":"README.rst","contentType":"file"},{"name":"SECURITY.md","path":"SECURITY.md","contentType":"file"},{"name":"checkstyle-suppressions.xml","path":"checkstyle-suppressions.xml","contentType":"file"},{"name":"checkstyle.xml","path":"checkstyle.xml","contentType":"file"},{"name":"codecov.yml","path":"codecov.yml","contentType":"file"},{"name":"crate-admin.gif","path":"crate-admin.gif","contentType":"file"},{"name":"forbidden-signatures.txt","path":"forbidden-signatures.txt","contentType":"file"},{"name":"mvnw","path":"mvnw","contentType":"file"},{"name":"mvnw.cmd","path":"mvnw.cmd","contentType":"file"},{"name":"pom.xml","path":"pom.xml","contentType":"file"},{"name":"setup.cfg","path":"setup.cfg","contentType":"file"}],"totalCount":40}},"fileTreeProcessingTime":5.027153,"foldersToFetch":[],"repo":{"id":9342529,"defaultBranch":"master","name":"crate","ownerLogin":"crate","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2013-04-10T09:17:16.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/4048232?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1710795648.0","canEdit":false,"refType":"branch","currentOid":"7f2fe72e629754251ef3e6568d3efd647b2db038"},"path":"devs/docs/plugins.rst","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/crate/crate/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"plugins.rst","displayUrl":"https://github.com/crate/crate/blob/master/devs/docs/plugins.rst?raw=true","headerInfo":{"blobSize":"3.34 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"e0e2945","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fcrate%2Fcrate%2Fblob%2Fmaster%2Fdevs%2Fdocs%2Fplugins.rst","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"Plugins","anchor":"plugins","htmlText":"Plugins"},{"level":2,"text":"Plugin CrateDB Dependency","anchor":"plugin-cratedb-dependency","htmlText":"Plugin CrateDB Dependency"},{"level":3,"text":"Gradle","anchor":"gradle","htmlText":"Gradle"},{"level":3,"text":"Maven","anchor":"maven","htmlText":"Maven"},{"level":2,"text":"Plugin Loading","anchor":"plugin-loading","htmlText":"Plugin Loading"},{"level":3,"text":"Constructor with Settings argument","anchor":"constructor-with-settings-argument","htmlText":"Constructor with Settings argument"},{"level":2,"text":"Plugin Interface","anchor":"plugin-interface","htmlText":"Plugin Interface"},{"level":2,"text":"Installing a Plugin","anchor":"installing-a-plugin","htmlText":"Installing a Plugin"}],"lineInfo":{"truncatedLoc":"139","truncatedSloc":"94"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"reStructuredText","languageID":419,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/crate/crate/blob/master/devs/docs/plugins.rst","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/crate/crate/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/crate/crate/raw/master/devs/docs/plugins.rst","renderImageOrRaw":false,"richText":"

Plugins

\n

CrateDB implements a plugin loading infrastructure. To add functionalities,\nyou can develop plugins for CrateDB.

\n

A plugin must:

\n\n

Refer to our CrateDB example plugin for more details.

\n\n

Plugin CrateDB Dependency

\n

In order to develop a plugin against a CrateDB release, a dependency to the\nCrateDB's server libraries must be set up.

\n\n

Gradle

\n

Define bintray (jCenter) repository:

\n
repositories {\n    jcenter()\n}
\n

Add CrateDB to compile dependencies:

\n
dependencies {\n    compile 'io.crate:crate:<VERSION>'\n}
\n\n

Maven

\n

Add bintray (jCenter) as a repository to your maven settings.xml:

\n
<profiles>\n  <profile>\n    <repositories>\n      <repository>\n        <snapshots>\n          <enabled>false</enabled>\n        </snapshots>\n        <id>central</id>\n        <name>bintray</name>\n        <url>http://jcenter.bintray.com</url>\n      </repository>\n    </repositories>\n    <id>bintray</id>\n  </profile>\n</profiles>\n\n<activeProfiles>\n  <activeProfile>bintray</activeProfile>\n</activeProfiles>
\n

Add CrateDB as a dependency:

\n
<dependencies>\n  <dependency>\n    <groupId>io.crate</groupId>\n    <artifactId>crate</artifactId>\n    <version>0.49.0</version>\n  </dependency>\n</dependencies>
\n\n

Plugin Loading

\n

Loading of plugins is done by CrateDB by searching all class path element\nresources for a META-INF/services/io.crate.Plugin file.

\n

Inside this file, one line is allowed to define the full qualified class\nname which implements the Plugin interface. This is similar to Java's\nServiceLoader.

\n\n

Constructor with Settings argument

\n

CrateDB passes a Settings instance to the plugin implementation constructor\nif such a constructor exists. Otherwise, an empty constructor is used. By using\nthe Settings instance, a plugin can process existing settings and/or\nimplement its own custom setting entries.

\n

The CrateDB example plugin makes use of that to implement a custom setting.

\n\n

Plugin Interface

\n

CrateDB uses the Guice module binding concept and so do plugins. As\ndescribed in the io.crate.Plugin interface, a plugin can load several\nmodule types by implementing relevant methods:

\n
\n\n
\n

This enables plugin developers to access a lot of functionality. But that comes\nat the price of API stability. Most of the components in CrateDB are considered\ninternal and may change with any version, including hotfix versions.

\n

The main purpose for the plugins right now is to add additional scalar\nfunctions or aggregation functions. An example of a plugin that does that is\nCrateDB example plugin.

\n\n

Installing a Plugin

\n

Installing a plugin is done by copying the plugin's JAR file(s) into the class\npath or to one of the following places:

\n
\n\n
\n\n
","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":true,"symbols":[]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/crate/crate/branches":{"post":"gTUBFJhD2nlvqbeireKmZ6bIMFipmBwlN7sfyN5RJZriR0AISuzedIshNNgZ-tYyOk7fov60Y0yZRmiPe57dtA"},"/repos/preferences":{"post":"XxGXnWwfkK39AACbwLqKPA23QhRz-JRWbuNIcdIcnmSHddbr4IQ-e0RvMHL7pukxfUPVDseXVsUk6P2oUuIJGw"}}},"title":"crate/devs/docs/plugins.rst at master ยท crate/crate"}