// Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/IncrementByOperation.java
// public class IncrementByOperation extends TreeMapBackupAwareOperation {
//     private String key;
//     private long by;
// 
//     public IncrementByOperation(String name, String key, long by) {
//         super(name);
//         this.by = by;
//         this.key = key;
//     }
// 
//     public IncrementByOperation() {
// 
//     }
// 
//     @Override
//     protected void writeInternal(ObjectDataOutput out) throws IOException {
//         super.writeInternal(out);
//         out.writeLong(by);
//         out.writeUTF(key);
//     }
// 
//     @Override
//     protected void readInternal(ObjectDataInput in) throws IOException {
//         super.readInternal(in);
//         by = in.readLong();
//         key = in.readUTF();
//     }
// 
//     @Override
//     public void run() throws Exception {
// 
//         OrderedCounterMap map = ((TreeMapService) getService()).getHLL(name);
//         map.increment(key, by);
//     }
// 
//     @Override
//     public Operation getBackupOperation() {
//         return new IncrementByBackupOperation();
//     }
// 
//     @Override
//     public int getId() {
//         return TreeMapSerializerFactory.ADD;
//     }
// }


import com.hazelcast.nio.serialization.PortableReader;
import com.hazelcast.nio.serialization.PortableWriter;
import com.hazelcast.spi.Operation;
import org.rakam.cache.hazelcast.treemap.operations.IncrementByOperation;
import java.io.IOException;
package org.rakam.cache.hazelcast.treemap.client;



/**
 * Created by buremba <Burak Emre Kabakcı> on 11/07/14 16:18.
 */
public class IncrementByRequest extends WriteRequest {

    private String key;
    private long inc;

    public IncrementByRequest(String name, String key, long inc) {
        super(name);
        this.key = key;
        this.inc = inc;
    }

    public IncrementByRequest() {

    }
    @Override
    public void write(PortableWriter writer) throws IOException {
        writer.writeUTF("n", name);
        writer.writeUTF("d", key);
        writer.writeLong("l", inc);
    }

    @Override
    public void read(PortableReader reader) throws IOException {
        name = reader.readUTF("n");
        key = reader.readUTF("d");
        inc = reader.readLong("l");
    }
    @Override
    protected Operation prepareOperation() {
// Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/IncrementByOperation.java
// public class IncrementByOperation extends TreeMapBackupAwareOperation {
//     private String key;
//     private long by;
// 
//     public IncrementByOperation(String name, String key, long by) {
//         super(name);
//         this.by = by;
//         this.key = key;
//     }
// 
//     public IncrementByOperation() {
// 
//     }
// 
//     @Override
//     protected void writeInternal(ObjectDataOutput out) throws IOException {
//         super.writeInternal(out);
//         out.writeLong(by);
//         out.writeUTF(key);
//     }
// 
//     @Override
//     protected void readInternal(ObjectDataInput in) throws IOException {
//         super.readInternal(in);
//         by = in.readLong();
//         key = in.readUTF();
//     }
// 
//     @Override
//     public void run() throws Exception {
// 
//         OrderedCounterMap map = ((TreeMapService) getService()).getHLL(name);
//         map.increment(key, by);
//     }
// 
//     @Override
//     public Operation getBackupOperation() {
//         return new IncrementByBackupOperation();
//     }
// 
//     @Override
//     public int getId() {
//         return TreeMapSerializerFactory.ADD;
//     }
// }


// Path: src/main/java/org/rakam/cache/hazelcast/treemap/client/IncrementByRequest.java
import com.hazelcast.nio.serialization.PortableReader;
import com.hazelcast.nio.serialization.PortableWriter;
import com.hazelcast.spi.Operation;
import org.rakam.cache.hazelcast.treemap.operations.IncrementByOperation;
import java.io.IOException;

package org.rakam.cache.hazelcast.treemap.client;



/**
 * Created by buremba <Burak Emre Kabakcı> on 11/07/14 16:18.
 */
public class IncrementByRequest extends WriteRequest {

    private String key;
    private long inc;

    public IncrementByRequest(String name, String key, long inc) {
        super(name);
        this.key = key;
        this.inc = inc;
    }

    public IncrementByRequest() {

    }
    @Override
    public void write(PortableWriter writer) throws IOException {
        writer.writeUTF("n", name);
        writer.writeUTF("d", key);
        writer.writeLong("l", inc);
    }

    @Override
    public void read(PortableReader reader) throws IOException {
        name = reader.readUTF("n");
        key = reader.readUTF("d");
        inc = reader.readLong("l");
    }
    @Override
    protected Operation prepareOperation() {
        return new IncrementByOperation(name, key, inc);