[
https://issues.apache.org/jira/browse/HBASE-5449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13438586#comment-13438586
]
Matteo Bertozzi commented on HBASE-5449:
----------------------------------------
the generated protobuf mergeFrom() code that parse the enum looks like this:
{code}
if (message contains enum) {
get the value of the enum
if (the value of the enum is not in the current proto definition)
mark the field as missing and add to the unknown fields
else
set the enum value
}
{code}
so basically, if you've an enum:
{code}
message MyMessage {
enum MyEnum {
ENUM_VALUE_1 = 1;
ENUM_VALUE_2 = 2;
ENUM_VALUE_3 = 3;
}
required MyEnum myEnum;
}
{code}
and then you switch to:
{code}
...
enum MyEnum {
ENUM_VALUE_1 = 1;
//ENUM_VALUE_2 = 2;
ENUM_VALUE_3 = 3;
ENUM_VALUE_4 = 4;
}
...
{code}
The old client can check for message.hasMyEnum().
if it is false, field is "missing" that in this case means I'm not able to find
the enum value in my current proto.
so protobuf is able to handle the case without problems.
The conversion code from protobuf to the real object is responsible to preserve
the compatibiliy...
I'll fix the patch to avoid throwing the exception in case of permission action
enum mismatch!
> Support for wire-compatible security functionality
> --------------------------------------------------
>
> Key: HBASE-5449
> URL: https://issues.apache.org/jira/browse/HBASE-5449
> Project: HBase
> Issue Type: Sub-task
> Components: ipc, master, migration, regionserver
> Reporter: Todd Lipcon
> Assignee: Matteo Bertozzi
> Attachments: AccessControl_protos.patch, HBASE-5449-v0.patch,
> HBASE-5449-v1.patch
>
>
--
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