[ 
https://issues.apache.org/jira/browse/SOLR-13661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Noble Paul updated SOLR-13661:
------------------------------
    Description: 
Solr needs a unified cohesive package management system so that users can 
deploy/redeploy plugins in a safe manner. This is an umbrella issue to 
eventually build that solution
h2. What is a package?

A package has 2 parts 
 * The {{jar}} binaries which may contain standard plugins (or even other 
libraries). It does not expect anything special. Basically , any jar file can 
be added into a package
 * The configuration in ZK. The structure is as follows

{code:json}
{
  "name": "package-name",
  "version": "some-version-string",
  "blob": {
    "sha256": "the-sha256-of-the-blob",
    "sig": "signature-signed-with-your-private-key",
    "name": "some-identifier"
  }
}
// use the following format for your multi jar package
{
  "name": "package-name",
  "version": "some-version-string",
  "blobs": [
    {
      "sha256": "the-sha256-of-the-blob",
      "sig": "signature-signed-with-your-private-key",
      "name": "some-identifier"
    }
  ]
}
{code}
 * {{*name*}} : this is identifier used to access the package
 * {{*version*}}: This is not consumed by the system. But, it is required so 
that the user can make out which version is being used
 * {{*blob/sha256*}}: The sha256 of the blob. You should have uploaded this 
blob into the new FS blob store
 * {{*blob/sig*}} : signature. ensure that your public keys are already there 
in {{/keys/exe}} in ZK
 * {{blob/name}} : a friendly identifier (not required)

Voila! this is all you need to have a package in Solr

Every package gets its own isolated unique classloader in a Solr node. The 
classloader is a child of the {{CoreContainer}} classloader. Basically, your 
classes have to be either in the root classloader or in the jars in your package
h2. What are the components of this system?
h3. {{PackageResourceLoader}} class

This is a standard {{SolrResourceLoader}} . It has all the blobs of a package 
in its classpath.
h3. {{PackageManager}} class

This is a registry of all Package classloaders . essentially a {{Map<String, 
PackageResourceLoader>}}
 This class is responsible for listening to the state changes in ZK to the 
packages ADD/UPDATE/DELETE operations.
 * ADD : create a new {{PackageResourceLoader}} and add it to the registry
 * UPDATE: create a new {{PackageResourceLoader}}, update the registry and 
notify every listener
 * DELETE: remove a {{PackageResourceLoader}}

h3.  The Listeners

Listeners listen to changes to packages. They get notified and they can take 
appropriate action

 h3. {{PackagePluginHolder}}

This is a special {{PluginHolder}} that is a {{PackageListener}} . Whenever it 
gets a notification of a package update , it reinitializes the plugin it's 
holding and throw away the old one


h2. {{FsBlobStore}} a.k.a FIle System Blob Store
This is a fully replicated file system blob store. 
* It lives at {{<solr.home>/blobs}} on each Solr node
* Every blob is a file. The file name is the sha256 of the blob

When the {{FsBlobStore}} is requested a blob, it

* looks up in the local file store for the file
* if not found, it asks the blob store in every other node in the cluster , 
until it finds a node with that blob.
* 



 

  was:Solr needs a unified cohesive package management system so that users can 
deploy/redeploy plugins in a safe manner. This is an umbrella issue to 
eventually build that solution


> A package management system for Solr
> ------------------------------------
>
>                 Key: SOLR-13661
>                 URL: https://issues.apache.org/jira/browse/SOLR-13661
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Noble Paul
>            Priority: Major
>              Labels: package
>         Attachments: plugin-usage.png, repos.png
>
>
> Solr needs a unified cohesive package management system so that users can 
> deploy/redeploy plugins in a safe manner. This is an umbrella issue to 
> eventually build that solution
> h2. What is a package?
> A package has 2 parts 
>  * The {{jar}} binaries which may contain standard plugins (or even other 
> libraries). It does not expect anything special. Basically , any jar file can 
> be added into a package
>  * The configuration in ZK. The structure is as follows
> {code:json}
> {
>   "name": "package-name",
>   "version": "some-version-string",
>   "blob": {
>     "sha256": "the-sha256-of-the-blob",
>     "sig": "signature-signed-with-your-private-key",
>     "name": "some-identifier"
>   }
> }
> // use the following format for your multi jar package
> {
>   "name": "package-name",
>   "version": "some-version-string",
>   "blobs": [
>     {
>       "sha256": "the-sha256-of-the-blob",
>       "sig": "signature-signed-with-your-private-key",
>       "name": "some-identifier"
>     }
>   ]
> }
> {code}
>  * {{*name*}} : this is identifier used to access the package
>  * {{*version*}}: This is not consumed by the system. But, it is required so 
> that the user can make out which version is being used
>  * {{*blob/sha256*}}: The sha256 of the blob. You should have uploaded this 
> blob into the new FS blob store
>  * {{*blob/sig*}} : signature. ensure that your public keys are already there 
> in {{/keys/exe}} in ZK
>  * {{blob/name}} : a friendly identifier (not required)
> Voila! this is all you need to have a package in Solr
> Every package gets its own isolated unique classloader in a Solr node. The 
> classloader is a child of the {{CoreContainer}} classloader. Basically, your 
> classes have to be either in the root classloader or in the jars in your 
> package
> h2. What are the components of this system?
> h3. {{PackageResourceLoader}} class
> This is a standard {{SolrResourceLoader}} . It has all the blobs of a package 
> in its classpath.
> h3. {{PackageManager}} class
> This is a registry of all Package classloaders . essentially a {{Map<String, 
> PackageResourceLoader>}}
>  This class is responsible for listening to the state changes in ZK to the 
> packages ADD/UPDATE/DELETE operations.
>  * ADD : create a new {{PackageResourceLoader}} and add it to the registry
>  * UPDATE: create a new {{PackageResourceLoader}}, update the registry and 
> notify every listener
>  * DELETE: remove a {{PackageResourceLoader}}
> h3.  The Listeners
> Listeners listen to changes to packages. They get notified and they can take 
> appropriate action
>  h3. {{PackagePluginHolder}}
> This is a special {{PluginHolder}} that is a {{PackageListener}} . Whenever 
> it gets a notification of a package update , it reinitializes the plugin it's 
> holding and throw away the old one
> h2. {{FsBlobStore}} a.k.a FIle System Blob Store
> This is a fully replicated file system blob store. 
> * It lives at {{<solr.home>/blobs}} on each Solr node
> * Every blob is a file. The file name is the sha256 of the blob
> When the {{FsBlobStore}} is requested a blob, it
> * looks up in the local file store for the file
> * if not found, it asks the blob store in every other node in the cluster , 
> until it finds a node with that blob.
> * 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to