avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Porter <gmpor...@gmail.com>
Subject Re: How to define an RPC message with a void return type
Date Sat, 01 Aug 2009 00:05:52 GMT
The issue showed up when I was implementing put() on the server side.

I had written the method like this:

{code}
@Override
  public Void put(ByteBuffer key, ByteBuffer value) throws AvroRemoteException {
    kvstore.put(key, value);
  }
{code}

and was getting compiler errors.  I just added a "return null;" and it
fixed the problem.  I guess that I had expected the compiler to
produce a method with a return type of 'void', rather than 'Void'.

Thanks,
George

On Fri, Jul 31, 2009 at 4:54 PM, Doug Cutting<cutting@apache.org> wrote:
> George Porter wrote:
>>
>> The 'put' message gets compiled into the following signature in Java:
>>
>> {code}
>> Void put(ByteBuffer key, ByteBuffer value)
>>    throws AvroRemoteException;
>> {code}
>>
>> Unfortunately, Void isn't an instantiatable type in Java.  Any thoughts?
>
> When do you need to instantiate a Void?  I'm not saying this isn't a
> problem, I'm just not yet sure where the problem is.
>
> Doug
>

Mime
View raw message