crunch-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Wills <josh.wi...@gmail.com>
Subject Re: Intended use of Writables.register(…)
Date Tue, 11 Dec 2012 17:34:53 GMT
Yeah, we need to sort out that WritableType package scoping issue. I think
the easiest way to do what you're doing now is with the derived()
functionality, which would look something like:

MapFn<UUIDWritable, UUID> inMapFn = ...;
MapFn<UUID, UUIDWritable> outMapFn = ...;
PType<UUID> = Writables.derived(UUID.class, inMapFn, outMapFn,
Writables.writables(UUIDWritable.class));

J



On Tue, Dec 11, 2012 at 9:15 AM, Whitacre,Micah
<MICAH.WHITACRE@cerner.com>wrote:

>  The situation I am going for is I want to end up with a PTable<UUID, Foo>
> so that I can do various operations like groupByKey etc.  It is pretty
> trivial to implement a UUIDWritable (someone posted an example impl)[1],
> but I'm trying to figure out how I could use Writables and specifically the register(Class<T>
> clazz, WritableType<T, ? extends Writable> ptype) method.  However since
> WritableType is package scoped I can't construct an instance to register.
>  Should the register method be package scoped as well?  Should WritableType
> have a public scope so that if I provide the two MapFn implementations +
> the Writable I can create one on my own?
>
>  I have seen that I could use Writables.writables(…) however that would
> give me something like PTable<UUIDWritable, Foo> instead.
>
>  Is there an easier way to accomplish what I'm trying to do?  UUID is
> pretty trivial and I could almost see it being part of Writables but I'm
> using it for building up to more complex items like Foo.
>
>  [1] - http://pastebin.com/NWbSFVvK
>  CONFIDENTIALITY NOTICE This message and any included attachments are
> from Cerner Corporation and are intended only for the addressee. The
> information contained in this message is confidential and may constitute
> inside or non-public information under international, federal, or state
> securities laws. Unauthorized forwarding, printing, copying, distribution,
> or use of such information is strictly prohibited and may be unlawful. If
> you are not the addressee, please promptly delete this message and notify
> the sender of the delivery error by e-mail or you may call Cerner's
> corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
>

Mime
View raw message