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

org.apache.tinkerpop.gremlin.ogm.caching.GraphMapperCache.kt Maven / Gradle / Ivy

There is a newer version: 0.21.0
Show newest version
package org.apache.tinkerpop.gremlin.ogm.caching

import org.apache.tinkerpop.gremlin.ogm.GraphEdge
import org.apache.tinkerpop.gremlin.ogm.GraphMapper
import org.apache.tinkerpop.gremlin.ogm.GraphVertex
import org.apache.tinkerpop.gremlin.ogm.elements.Edge
import org.apache.tinkerpop.gremlin.ogm.elements.Vertex

/**
 * The cache used by a CachedGraphMapper. The implementation should be thread-safe if a
 * CachedGraphMapper using this cache is shared across threads.
 */
interface GraphMapperCache {

    /**
     * Requests that the vertex be explicitly cached using its serialized graph form as the key.
     */
    fun  put(serialized: GraphVertex, deserialized: V)

    /**
     * Requests a vertex from the cache for a given serialized vertex. If there is a cache miss, implementors
     * should call CachedGraphMapper#load
     */
    fun  get(serialized: GraphVertex): V

    /**
     * Requests that the edge be explicitly cached using its serialized graph form as the key.
     */
    fun > put(serialized: GraphEdge, deserialized: E)

    /**
     * Requests an edge from the cache for a given serialized edge. If there is a cache miss, implementors
     * should call CachedGraphMapper#load
     */
    fun > get(serialized: GraphEdge): E
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy