Search in sources :

Example 1 with LocalSnapshotListener

use of com.alibaba.graphscope.groot.coordinator.LocalSnapshotListener in project GraphScope by alibaba.

the class LocalSnapshotListenerTest method testListener.

@Test
void testListener() {
    SchemaManager schemaManager = mock(SchemaManager.class);
    GraphDef graphDef = GraphDef.newBuilder().setVersion(3L).build();
    when(schemaManager.getGraphDef()).thenReturn(graphDef);
    SnapshotCache snapshotCache = mock(SnapshotCache.class);
    LocalSnapshotListener listener = new LocalSnapshotListener(schemaManager, snapshotCache);
    listener.snapshotAdvanced(10L, 10L);
    verify(snapshotCache).advanceQuerySnapshotId(eq(10L), eq(graphDef));
    listener.snapshotAdvanced(20L, 10L);
    verify(snapshotCache).advanceQuerySnapshotId(eq(20L), isNull());
}
Also used : SchemaManager(com.alibaba.graphscope.groot.coordinator.SchemaManager) SnapshotCache(com.alibaba.graphscope.groot.SnapshotCache) LocalSnapshotListener(com.alibaba.graphscope.groot.coordinator.LocalSnapshotListener) GraphDef(com.alibaba.maxgraph.sdkcommon.schema.GraphDef) Test(org.junit.jupiter.api.Test)

Aggregations

SnapshotCache (com.alibaba.graphscope.groot.SnapshotCache)1 LocalSnapshotListener (com.alibaba.graphscope.groot.coordinator.LocalSnapshotListener)1 SchemaManager (com.alibaba.graphscope.groot.coordinator.SchemaManager)1 GraphDef (com.alibaba.maxgraph.sdkcommon.schema.GraphDef)1 Test (org.junit.jupiter.api.Test)1