avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Santa Barbara <jus...@fathomdb.com>
Subject Why Paranamer?
Date Wed, 11 Nov 2009 04:47:20 GMT
Given some of the complexities involved in paranamer builds, I'm wondering
why Avro doesn't use annotations instead.  It seems that parameter names are
only needed for Avro interfaces, and these are mostly generated from .avpr
files (rather than being hand-written).

I've done a quick implementation, and it seems to work well:
http://github.com/justinsb/avro/commit/b5532e3bf8967a6e97c795a480f74731945849e5

The actual @Named annotation is here:
http://github.com/justinsb/avro/blob/259047e9b51bdb690a8b2c0ce5693ba65ed94536/src/java/org/apache/avro/Named.java

So an example generated interface looks like this, and there's no need to
run Paranamer:

@SuppressWarnings("all")
public interface BulkData {
  ByteBuffer read() throws AvroRemoteException;
  Void write(@Named("data") ByteBuffer data) throws AvroRemoteException;
}

I'm guessing there's some historical reason here - can anyone fill me in on
the reasoning?

Justin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message