avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Oliver (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AVRO-261) Allow Schemas to be immutable
Date Fri, 18 Dec 2009 19:06:18 GMT

    [ https://issues.apache.org/jira/browse/AVRO-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792583#action_12792583

Kevin Oliver commented on AVRO-261:

I can think of 2 approaches to take here:
1) Add a boolean flag to Schema, lets call it locked, that prevents modifications. Users could
call Schema.lock() which would then set the flag and prevent further mutations (on the properties,
fields, etc). 
2) Convert Schema to an interface and have an implementation that never allows for modifications.

Any interest? Any preference in which approach to take?

> Allow Schemas to be immutable
> -----------------------------
>                 Key: AVRO-261
>                 URL: https://issues.apache.org/jira/browse/AVRO-261
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>            Reporter: Kevin Oliver
>            Priority: Minor
> It would be nice if there was the ability to have an immutable Schema in java. 
> Without this, it makes sharing schemas risky. Also, with this, we could (lazily) cache
the hashCode which is a fairly expensive operation today, especially on something like a record.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message