apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gaurav Gupta <gau...@datatorrent.com>
Subject Re: New Download Page
Date Fri, 13 Nov 2015 14:52:39 GMT
Michael,

Here is what you should do..
Create a new Serializer

import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.UUID;

import com.esotericsoftware.kryo.Kryo;

public class CustomeSerializableStreamCodec<T> extends com.datatorrent.lib.codec.KryoSerializableStreamCodec
{

  public CustomeSerializableStreamCodec()
  {
    this.kryo = new Kryo();
    this.kryo.setClassLoader(Thread.currentThread().getContextClassLoader());
  }

  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
  {
    in.defaultReadObject();
    this.kryo = new Kryo();
    this.kryo.setClassLoader(Thread.currentThread().getContextClassLoader());
    this.kryo.register(UUID.class, new UUIDSerializer()); // Register your classes here
  }

  private static final long serialVersionUID = 201411031405L;
}

In your DAG, use this Serializer on the input port that is expecting the UUID tuple something
like this

CustomeSerializableStreamCodec codec = new CustomeSerializableStreamCodec<>();
dag.setInputPortAttribute(output.input, Context.PortContext.STREAM_CODEC, codec);

Thanks
- Gaurav

> On Nov 13, 2015, at 6:31 AM, Andy Perlitch <andy@datatorrent.com> wrote:
> 
> Thomas- Will take a look regarding release date.
> Gaurav- I believe this is a browser cache issue
> Justin- I'll add KEYS, instructions, and link to README
> 
> Thanks for the feedback!
> 
> -Andy
> 
> On Thursday, November 12, 2015, Justin Mclean <justinmclean@me.com> wrote:
> 
>> Hi,
>> 
>> You might want to place the KEYS file in the directory and including
>> instructions for verifying the download. Having a link to the README might
>> also be useful.
>> 
>> Thanks,
>> Justin
>> 
>> 
>> 
> 
> -- 
> Regards,
> Andy Perlitch
> Software Engineer
> DataTorrent Inc
> (408)829-9319


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