[ 
https://issues.apache.org/jira/browse/HBASE-4459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126864#comment-13126864
 ] 

stack commented on HBASE-4459:
------------------------------

What is this about?

{code}
+    } else if (Queue.class.isAssignableFrom(declClass)) {
+      Queue queue = (Queue)instanceObj;
+      int length = queue.size();
+      out.writeInt(length);
+      Object obj;
+      for (int i = 0; i < length; i++) {
+        obj = queue.remove();
+        writeObject(out, obj, obj.getClass(), conf);
+      }
{code}

Is it necessary to this patch?

And this:

{code}
+    } else if (Queue.class.isAssignableFrom(declaredClass)) {
+      int length = in.readInt();
+      instance = new ConcurrentLinkedQueue();
+      for (int i = 0; i < length; i++) {
+        ((Queue)instance).add(readObject(in, conf));
+      }
{code}

Looks good Ram.  Any chance of a test to prove it works the way it used to?
                
> HbaseObjectWritable code is a byte, we will eventually run out of codes
> -----------------------------------------------------------------------
>
>                 Key: HBASE-4459
>                 URL: https://issues.apache.org/jira/browse/HBASE-4459
>             Project: HBase
>          Issue Type: Bug
>          Components: io
>            Reporter: Jonathan Gray
>            Assignee: ramkrishna.s.vasudevan
>            Priority: Critical
>             Fix For: 0.92.0
>
>         Attachments: 4459.txt
>
>
> There are about 90 classes/codes in HbaseObjectWritable currently and 
> Byte.MAX_VALUE is 127.  In addition, anyone wanting to add custom classes but 
> not break compatibility might want to leave a gap before using codes and 
> that's difficult in such limited space.
> Eventually we should get rid of this pattern that makes compatibility 
> difficult (better client/server protocol handshake) but we should probably at 
> least bump this to a short for 0.94.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to