MVStore Datatype Example

256 views
Skip to first unread message

Paul Fraser

unread,
Mar 30, 2016, 7:55:15 AM3/30/16
to H2 Database
Hi,

Can anyone point me to a simple example of custom serializer implementing MVStore datatype.

I have found the JackRabbit ValueDatatType but it seems to be very specialized.

Or alternatively, how to code this :-


 public class MyClazz implements DataType {

private String name;
private Integer size;
private boolean running = false;
private Set<String> persons;
private ArrayList<Long> accountIds;
 
    
    public MyClazz() {
     }

 
    @Override
    public int compare(Object arg0, Object arg1) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int getMemory(Object arg0) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public Object read(ByteBuffer buf) {
         return null;
    }

    @Override
    public void read(ByteBuffer buf, Object[] arg1, int arg2, boolean arg3) {
       }

    @Override
    public void write(WriteBuffer arg0, Object arg1) {
     }

    @Override
    public void write(WriteBuffer arg0, Object[] arg1, int arg2, boolean arg3) {
     }

}


An example in the documentation would be a great help.

Thanks,

Paul Fraser

Noel Grandin

unread,
Mar 30, 2016, 8:40:37 AM3/30/16
to h2-da...@googlegroups.com

Paul F Fraser

unread,
Mar 30, 2016, 5:58:59 PM3/30/16
to h2-da...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages