accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Tubbs (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-1003) what is the point of SecuritySerDe?
Date Sun, 03 Feb 2013 21:52:12 GMT


Christopher Tubbs commented on ACCUMULO-1003:

This is overly complex, and the generic parameters don't provide compile time checks correctly.

For instance, say I want to serialize a UserPassToken:
UserPassToken token = new UserPassToken("user", "password".getBytes());

Not only does this fail to compile, without casts that obviate the use of generic parameters,
it's confusing to pass token twice.

To support a generic serialization strategy, it would be preferable to have some sort of visitor
pattern like:
public class SecurityToken<T extends SecurityToken<T>> {
    public <S> S serialize(Serializer<? extends T,S> serializer);
// with a specific implementation like
public class UserPassToken<UserPassToken> {
    public <S> S serialize(Serializer<? extends UserPassToken,S>);
// which could be used like
public class UserPassToBytesSerializer extends Serializer<UserPassToken,byte[]> {...};
byte[] bytes = token.serialize(new UserPassToBytesSerializer());

But even this, while simple and flexible for users, is a bit complex to maintain. I'd prefer
just a simple Writable, or other "convertToBytes()" / "convertFromBytes()" simple strategy.
> what is the point of SecuritySerDe?
> -----------------------------------
>                 Key: ACCUMULO-1003
>                 URL:
>             Project: Accumulo
>          Issue Type: Sub-task
>          Components: master, tserver
>            Reporter: Eric Newton
>            Assignee: John Vines
>             Fix For: 1.5.0
> What is the point of the factory method getSerDe() (which, BTW is an awful name)?   Why
not just make SecurityToken Writable?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message