You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@artemis.apache.org by "clebertsuconic (via GitHub)" <gi...@apache.org> on 2026/07/16 15:55:21 UTC

[PR] NO-JIRA AbstractMapPersister [artemis]

clebertsuconic opened a new pull request, #6585:
URL: https://github.com/apache/artemis/pull/6585

   This is bringing AbstractMapPersister to utils.
   Future datatypes would be able to use this to persist map like data structures


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6158 AbstractMapPersister [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic merged PR #6585:
URL: https://github.com/apache/artemis/pull/6585


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6158 AbstractMapPersister [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #6585:
URL: https://github.com/apache/artemis/pull/6585#discussion_r3598908258


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractMapPersister.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.utils;
+
+import java.lang.invoke.MethodHandles;
+import java.util.function.Consumer;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class encapsulates the encoding and decoding of a {@code Map<Short, Object>}.
+ * It supports encoding of objects of type Boolean, SimpleString, Integer, Long, Byte and Byte Array
+ * It provides support to predetermine the size of the encoding, and a callback reader for subclasses.
+ */
+public abstract class AbstractMapPersister<T> {
+
+   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   enum Datatypes {
+      BOOLEAN((byte)0), SIMPLE_STRING((byte)1), INTEGER((byte)2), LONG((byte)3), BYTE((byte)4), BYTE_ARRAY((byte)5);

Review Comment:
   I am playing with a strict sizing requirement, which I cannot do with UTF8.
   
   For example when writing to the journal I need to know exactly how many bytes I am going to write ahead of time. and UTF8 has variable sizing for Unicode Strings.
   
   We are going to use this on the wire.. but I think we should play with similar constraints here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] NO-JIRA AbstractMapPersister [artemis]

Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on code in PR #6585:
URL: https://github.com/apache/artemis/pull/6585#discussion_r3597941466


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractMapPersister.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.utils;
+
+import java.lang.invoke.MethodHandles;
+import java.util.function.Consumer;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class encapsulates the encoding and decoding of a {@code Map<Short, Object>}.
+ * It supports encoding of objects of type Boolean, SimpleString, Integer, Long, Byte and Byte Array
+ * It provides support to predetermine the size of the encoding, and a callback reader for subclasses.
+ */
+public abstract class AbstractMapPersister<T> {
+
+   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   enum Datatypes {
+      BOOLEAN((byte)0), SIMPLE_STRING((byte)1), INTEGER((byte)2), LONG((byte)3), BYTE((byte)4), BYTE_ARRAY((byte)5);

Review Comment:
   Given this is new code and comes from code that was meant to write state data about AMQP messages we should be more generic and not use SimpleString as I'd prefer going forward we eliminate its existence in every place possible.  I'm guessing that one motivation to use it was that it supports writing a null version but that is easy enough to do without it, via a size value of -1 or a boolean prefix that indicates null by being false or not null by being true.  Then you can just write UTF8 bytes which is generally applicable to things that aren't Core as well.  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6158 AbstractMapPersister [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on PR #6585:
URL: https://github.com/apache/artemis/pull/6585#issuecomment-5004053498

   I can follow up with additional commits if anyone have anything to add here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6158 AbstractMapPersister [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #6585:
URL: https://github.com/apache/artemis/pull/6585#discussion_r3599259818


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractMapPersister.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.utils;
+
+import java.lang.invoke.MethodHandles;
+import java.util.function.Consumer;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class encapsulates the encoding and decoding of a {@code Map<Short, Object>}.
+ * It supports encoding of objects of type Boolean, SimpleString, Integer, Long, Byte and Byte Array
+ * It provides support to predetermine the size of the encoding, and a callback reader for subclasses.
+ */
+public abstract class AbstractMapPersister<T> {
+
+   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   enum Datatypes {
+      BOOLEAN((byte)0), SIMPLE_STRING((byte)1), INTEGER((byte)2), LONG((byte)3), BYTE((byte)4), BYTE_ARRAY((byte)5);

Review Comment:
   fixed it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] NO-JIRA AbstractMapPersister [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #6585:
URL: https://github.com/apache/artemis/pull/6585#discussion_r3598078652


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractMapPersister.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.utils;
+
+import java.lang.invoke.MethodHandles;
+import java.util.function.Consumer;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class encapsulates the encoding and decoding of a {@code Map<Short, Object>}.
+ * It supports encoding of objects of type Boolean, SimpleString, Integer, Long, Byte and Byte Array
+ * It provides support to predetermine the size of the encoding, and a callback reader for subclasses.
+ */
+public abstract class AbstractMapPersister<T> {
+
+   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   enum Datatypes {
+      BOOLEAN((byte)0), SIMPLE_STRING((byte)1), INTEGER((byte)2), LONG((byte)3), BYTE((byte)4), BYTE_ARRAY((byte)5);

Review Comment:
   there's no need to support NULL. you can simply not have the field written. skip the writing.
   
   
   I can use Strings. the issue I have is writeUTF8 has an issue as you have to first encode before knowing its size (for non ascii strings).. I could use writeChars, similar to how SimpleString is encoded.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6158 AbstractMapPersister [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #6585:
URL: https://github.com/apache/artemis/pull/6585#discussion_r3598695091


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractMapPersister.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.utils;
+
+import java.lang.invoke.MethodHandles;
+import java.util.function.Consumer;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class encapsulates the encoding and decoding of a {@code Map<Short, Object>}.
+ * It supports encoding of objects of type Boolean, SimpleString, Integer, Long, Byte and Byte Array
+ * It provides support to predetermine the size of the encoding, and a callback reader for subclasses.
+ */
+public abstract class AbstractMapPersister<T> {
+
+   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   enum Datatypes {
+      BOOLEAN((byte)0), SIMPLE_STRING((byte)1), INTEGER((byte)2), LONG((byte)3), BYTE((byte)4), BYTE_ARRAY((byte)5);

Review Comment:
   I removed SimpleString support.. and I added UTF16_LE. 
   
   I added writeUTF16 methods that will be writing 2 bytes per character.
   
   we can add other String types in the future if we need. 
   
   our packets need to know the size ahead of time. so you would need to calculate the size, to then waste the time of the write and caculate it again.. or play with ThreadLocals ... etc... 
   
   
   
   for now I think we can use writeUTF16. 
   
   
   I have removed support for null for now.. although you could write 0 if null.
   
   (On my usage on the amqp-size, i will ignore the writeString if the field is null).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6158 AbstractMapPersister [artemis]

Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on code in PR #6585:
URL: https://github.com/apache/artemis/pull/6585#discussion_r3598774717


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractMapPersister.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.utils;
+
+import java.lang.invoke.MethodHandles;
+import java.util.function.Consumer;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class encapsulates the encoding and decoding of a {@code Map<Short, Object>}.
+ * It supports encoding of objects of type Boolean, SimpleString, Integer, Long, Byte and Byte Array
+ * It provides support to predetermine the size of the encoding, and a callback reader for subclasses.
+ */
+public abstract class AbstractMapPersister<T> {
+
+   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   enum Datatypes {
+      BOOLEAN((byte)0), SIMPLE_STRING((byte)1), INTEGER((byte)2), LONG((byte)3), BYTE((byte)4), BYTE_ARRAY((byte)5);

Review Comment:
   Why would you not use the more common UTF8 encoding which wouldn't change your current code at all but would encode all ASCII values as one byte per character? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] NO-JIRA AbstractMapPersister [artemis]

Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on PR #6585:
URL: https://github.com/apache/artemis/pull/6585#issuecomment-4995217819

   I'm think even this one could have a JIRA assigned


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] NO-JIRA AbstractMapPersister [artemis]

Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on code in PR #6585:
URL: https://github.com/apache/artemis/pull/6585#discussion_r3598099159


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractMapPersister.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.utils;
+
+import java.lang.invoke.MethodHandles;
+import java.util.function.Consumer;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class encapsulates the encoding and decoding of a {@code Map<Short, Object>}.
+ * It supports encoding of objects of type Boolean, SimpleString, Integer, Long, Byte and Byte Array
+ * It provides support to predetermine the size of the encoding, and a callback reader for subclasses.
+ */
+public abstract class AbstractMapPersister<T> {
+
+   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   enum Datatypes {
+      BOOLEAN((byte)0), SIMPLE_STRING((byte)1), INTEGER((byte)2), LONG((byte)3), BYTE((byte)4), BYTE_ARRAY((byte)5);

Review Comment:
   I wouldn't say that's an issue, its just how it works.  If you are writing to a buffer you can always write a zero in the size field and then use set(index, size) to update it once you are done if you track where you started and where you ended then the size is just the difference in bytes 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6158 AbstractMapPersister [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #6585:
URL: https://github.com/apache/artemis/pull/6585#discussion_r3599106394


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractMapPersister.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.utils;
+
+import java.lang.invoke.MethodHandles;
+import java.util.function.Consumer;
+
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class encapsulates the encoding and decoding of a {@code Map<Short, Object>}.
+ * It supports encoding of objects of type Boolean, SimpleString, Integer, Long, Byte and Byte Array
+ * It provides support to predetermine the size of the encoding, and a callback reader for subclasses.
+ */
+public abstract class AbstractMapPersister<T> {
+
+   private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+   enum Datatypes {
+      BOOLEAN((byte)0), SIMPLE_STRING((byte)1), INTEGER((byte)2), LONG((byte)3), BYTE((byte)4), BYTE_ARRAY((byte)5);

Review Comment:
   I will fix it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org