[jira] [Updated] (OPENNLP-776) Model Objects should be Serializable
[ https://issues.apache.org/jira/browse/OPENNLP-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tristan Nixon updated OPENNLP-776: -- Attachment: serialization_proxy.patch Patch containing modifications to model classes to provide serialization proxies. > Model Objects should be Serializable > > > Key: OPENNLP-776 > URL: https://issues.apache.org/jira/browse/OPENNLP-776 > Project: OpenNLP > Issue Type: Improvement >Affects Versions: tools-1.5.3 >Reporter: Tristan Nixon >Priority: Minor > Labels: features, patch > Fix For: 1.6.1 > > Attachments: externalizable.patch, serialization_proxy.patch > > > Marking model objects (ParserModel, SentenceModel, etc.) as Serializable can > enable a number of features offered by other Java frameworks (my own use case > is described below). You've already got a good mechanism for > (de-)serialization, but it cannot be leveraged by other frameworks without > implementing the Serializable interface. I'm attaching a patch to BaseModel > that implements the methods in the java.io.Externalizable interface as > wrappers to the existing (de-)serialization methods. This simple change can > open up a number of useful opportunities for integrating OpenNLP with other > frameworks. > My use case is that I am incorporating OpenNLP into a Spark application. This > requires that components of the system be distributed between the driver and > worker nodes within the cluster. In order to do this, Spark uses Java > serialization API to transmit objects between nodes. This is far more > efficient than instantiating models on each node independently. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (OPENNLP-776) Model Objects should be Serializable
[ https://issues.apache.org/jira/browse/OPENNLP-776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15427213#comment-15427213 ] Tristan Nixon commented on OPENNLP-776: --- True, you don't need setters for serialization. The above document section does say that Serializable classes must "Have access to the no-arg constructor of its first nonserializable superclass" However, it got me thinking and I found this article on serializing immutable classes: https://lingpipe-blog.com/2009/08/10/serializing-immutable-singletons-serialization-proxy/ Basically, one can supply a proxy class (which does have a no-arg constructor) as a stand-in for another immutable class. This seems to satisfy all our desires for a solution here, so I went ahead and implemented it. Each model will instantiate an appropriate externalizable proxy class, and supply that to the java serialization system. No-arg constructors not needed :) I will attach a patch with this solution. > Model Objects should be Serializable > > > Key: OPENNLP-776 > URL: https://issues.apache.org/jira/browse/OPENNLP-776 > Project: OpenNLP > Issue Type: Improvement >Affects Versions: tools-1.5.3 >Reporter: Tristan Nixon >Priority: Minor > Labels: features, patch > Fix For: 1.6.1 > > Attachments: externalizable.patch > > > Marking model objects (ParserModel, SentenceModel, etc.) as Serializable can > enable a number of features offered by other Java frameworks (my own use case > is described below). You've already got a good mechanism for > (de-)serialization, but it cannot be leveraged by other frameworks without > implementing the Serializable interface. I'm attaching a patch to BaseModel > that implements the methods in the java.io.Externalizable interface as > wrappers to the existing (de-)serialization methods. This simple change can > open up a number of useful opportunities for integrating OpenNLP with other > frameworks. > My use case is that I am incorporating OpenNLP into a Spark application. This > requires that components of the system be distributed between the driver and > worker nodes within the cluster. In order to do this, Spark uses Java > serialization API to transmit objects between nodes. This is far more > efficient than instantiating models on each node independently. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (OPENNLP-860) Migrate to git
Joern Kottmann created OPENNLP-860: -- Summary: Migrate to git Key: OPENNLP-860 URL: https://issues.apache.org/jira/browse/OPENNLP-860 Project: OpenNLP Issue Type: Task Reporter: Joern Kottmann The git repository is now available. There are a couple of things that should be done to finish this: - Discuss repository with Infra (currently we only have trunk) - Update the website with new git links and instructions - Update the build to work with git - Announce the change on the dev list for everyone who is not involved in the migration -- This message was sent by Atlassian JIRA (v6.3.4#6332)