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

com.fasterxml.clustermate.service.state.NodeStateStoreHelper Maven / Gradle / Ivy

There is a newer version: 0.10.5
Show newest version
package com.fasterxml.clustermate.service.state;

import java.io.File;

import com.fasterxml.clustermate.service.SharedServiceStuff;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.storemate.shared.IpAndPort;
import com.fasterxml.storemate.store.backend.StoreBackendBuilder;
import com.fasterxml.storemate.store.state.NodeStateStore;

public abstract class NodeStateStoreHelper
{
    public static NodeStateStore defaultNodeStateStore(StoreBackendBuilder backendBuilder,
            SharedServiceStuff stuff, File metadataDir)
    {
        final ObjectMapper mapper = stuff.jsonMapper();
        NodeStateStore nodeStates =
                backendBuilder.buildNodeStateStore(metadataDir,
                        new JacksonBasedConverter(mapper, IpAndPort.class),
                        new JacksonBasedConverter(mapper, ActiveNodeState.class));
        return nodeStates;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy