Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-6553 Configuration Serialization #4274

Conversation

tristantarrant
Copy link
Member

https://issues.jboss.org/browse/ISPN-6552
Merge parsers
https://issues.jboss.org/browse/ISPN-6553
Configuration serialization
https://issues.jboss.org/browse/ISPN-6554
XML configuration converter for 6.0 files



/**
* Writes this attributes to the specified XMLStreamWriter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Javadoc could be probably removed or we should add proper docs to the rest of the methods (I would vote for the latter).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added javadocs

@slaskawi
Copy link
Contributor

There are some CI failures that seems to be related

@slaskawi
Copy link
Contributor

This PR is gigantic. Are there any places where we should focus on?

@tristantarrant
Copy link
Member Author

Yes, sorry about the size.

  • This adds a new "ConfigurationSerializer" interface which is the symmetric implementation of a ConfigurationParser.
  • AttributeSets now can "write" themselves and some changes have been made to support this. I have changed many attribute names to their xml tag form, aside from the ones that need to be referenced as properties for backwards compatibility (e.g. cachestores)
  • The Configuration Converter for 6.0 is basically the old parser, which is used to read an old format into an in-memory Configuration and which is then serialized back using the ConfigurationSerializer
  • I have also merged all versioned parsers into single ones.
  • I found a bad bug in the ServiceFinder implementation which, when supplied with multiple classloaders, would return multiple instances of services.

@tristantarrant tristantarrant force-pushed the ISPN-6553/config_serialization branch from 024c266 to 19fa6c9 Compare May 2, 2016 12:34
@@ -25,7 +27,7 @@
private static final Log LOG = LogFactory.getLog(ServiceFinder.class);

public static <T> Set<T> load(Class<T> contract, ClassLoader... loaders) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can return a Collection<T>...

static final AttributeDefinition<Integer> MAX_FILE_SIZE = AttributeDefinition.builder("maxFileSize", 16 * 1024 * 1024).immutable().autoPersist(false).build();
static final AttributeDefinition<Integer> MIN_NODE_SIZE = AttributeDefinition.builder("minNodeSize", -1).immutable().autoPersist(false).build();
static final AttributeDefinition<Integer> MAX_NODE_SIZE = AttributeDefinition.builder("maxNodeSize", 4096).immutable().autoPersist(false).build();
static final AttributeDefinition<Integer> INDEX_QUEUE_LENGTH = AttributeDefinition.builder("indexQueueLength", 1000).immutable().autoPersist(false).build();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing .xmlName("max-queue-length")

@pruivo
Copy link
Member

pruivo commented May 6, 2016

hey @tristantarrant, I've finished my review about the unit test for the cache-stores. it is just a couple of minor fixes :)

@tristantarrant tristantarrant force-pushed the ISPN-6553/config_serialization branch 3 times, most recently from 7bae908 to f53885e Compare May 9, 2016 10:25
@tristantarrant
Copy link
Member Author

@pruivo done

@tristantarrant tristantarrant force-pushed the ISPN-6553/config_serialization branch from f53885e to 5826792 Compare May 9, 2016 10:41
@tristantarrant
Copy link
Member Author

Right :)

@tristantarrant tristantarrant force-pushed the ISPN-6553/config_serialization branch from 5826792 to c03b784 Compare May 9, 2016 10:49
static final AttributeDefinition<Boolean> SYNC_WRITES = AttributeDefinition.builder("syncWrites", false).immutable().build();
static final AttributeDefinition<String> DATA_LOCATION = AttributeDefinition.builder("dataLocation", "Infinispan-SoftIndexFileStore-Data").immutable().autoPersist(false).xmlName("path").build();
static final AttributeDefinition<String> INDEX_LOCATION = AttributeDefinition.builder("indexLocation", "Infinispan-SoftIndexFileStore-Index").immutable().autoPersist(false).xmlName("path").build();
static final AttributeDefinition<Integer> INDEX_SEGMENTS = AttributeDefinition.builder("indexSegments", 3).immutable().autoPersist(false).autoPersist(false).xmlName("segments").build();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: autoPersist invoked twice.

@tristantarrant tristantarrant force-pushed the ISPN-6553/config_serialization branch from c03b784 to 201faf5 Compare May 9, 2016 12:25
@tristantarrant
Copy link
Member Author

Now ? :)

if (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
throw ParseUtils.unexpectedElement(reader);
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
Element element = Element.forName(reader.getLocalName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@pruivo
Copy link
Member

pruivo commented May 9, 2016

just on last comment. it looks good to me.
@slaskawi or @wburns do you have any other comment?

@tristantarrant tristantarrant force-pushed the ISPN-6553/config_serialization branch from 201faf5 to 4dd4f8b Compare May 9, 2016 13:16
@slaskawi
Copy link
Contributor

Nope, looks good to me.

@pruivo
Copy link
Member

pruivo commented May 10, 2016

integrated! thanks @tristantarrant !

@pruivo pruivo closed this May 10, 2016
@tristantarrant tristantarrant deleted the ISPN-6553/config_serialization branch September 1, 2016 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants