All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.boon.slumberdb.mysql.SimpleKryoKeyValueStoreMySQL Maven / Gradle / Ivy

There is a newer version: 0.34
Show newest version
package org.boon.slumberdb.mysql;

import com.esotericsoftware.kryo.Kryo;
import org.boon.slumberdb.impl.SerializedJavaKeyValueStore;
import org.boon.slumberdb.base.BaseStringBinaryKeyValueStore;
import org.boon.slumberdb.serialization.KryoByteArrayToObjectConverter;
import org.boon.slumberdb.serialization.KryoObjectToByteArrayConverter;

import java.io.Serializable;

/**
 * Created by Richard on 4/5/14.
 */
public class SimpleKryoKeyValueStoreMySQL extends BaseStringBinaryKeyValueStore implements SerializedJavaKeyValueStore {

    /**
     * Kryo valueObjectConverter/valueSerializer
     */
    private final Kryo kryo = new Kryo();


    public SimpleKryoKeyValueStoreMySQL(String url, String userName, String password, String table, Class type, int batchSize) {
        super(new SimpleStringBinaryKeyValueStoreMySQL(url, userName, password, table, batchSize));
        this.valueObjectConverter = new KryoByteArrayToObjectConverter<>(kryo, type);
        this.valueSerializer = new KryoObjectToByteArrayConverter<>(kryo, type);
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy