protected Graph getGraph() { if (graph != null) { return graph; } graph = InMemoryGraph.create(); return graph; }
@Override protected void alterElementPropertyMetadata( InMemoryTableElement inMemoryTableElement, List<SetPropertyMetadata> setPropertyMetadatas, Authorizations authorizations ) { super.alterElementPropertyMetadata(inMemoryTableElement, setPropertyMetadatas, authorizations); ((Storable) inMemoryTableElement).store(); }
@SuppressWarnings("unused") public static InMemoryGraph create(InMemoryGraphConfiguration config, IdGenerator idGenerator, SearchIndex searchIndex) { InMemoryGraph graph = new InMemoryGraph(config, idGenerator, searchIndex); graph.setup(); return graph; }
null ); graph = InMemoryGraph.create(); termMentionAuthorizations = graph.createAuthorizations(TermMentionRepository.VISIBILITY_STRING, VISIBILITY_SOURCE, WORKSPACE_ID); visibility = new Visibility(VISIBILITY_SOURCE); visibilityJson = new VisibilityJson();
protected Graph getGraph() { if (graph == null) { Map graphConfiguration = getConfigurationMap(); InMemoryGraphConfiguration inMemoryGraphConfiguration = new InMemoryGraphConfiguration(graphConfiguration); graph = InMemoryGraph.create(inMemoryGraphConfiguration, getGraphIdGenerator(), getGraphSearchIndex(inMemoryGraphConfiguration)); graph.defineProperty(VisalloProperties.CONCEPT_TYPE.getPropertyName()).dataType(String.class).textIndexHint(TextIndexHint.EXACT_MATCH).define(); graph.defineProperty(VisalloProperties.MODIFIED_BY.getPropertyName()).dataType(String.class).textIndexHint(TextIndexHint.EXACT_MATCH).define(); graph.defineProperty(VisalloProperties.MODIFIED_DATE.getPropertyName()).dataType(Date.class).define(); graph.defineProperty(VisalloProperties.VISIBILITY_JSON.getPropertyName()).dataType(String.class).define(); graph.defineProperty(VisalloProperties.TEXT.getPropertyName()).dataType(String.class).textIndexHint(TextIndexHint.FULL_TEXT).define(); } return graph; }
graph.alterElementPropertyMetadata(inMemoryTableElement, mutation.getSetPropertyMetadatas(), authorizations); graph.alterElementPropertyVisibilities( inMemoryTableElement, mutation.getAlterPropertyVisibilities(), authorizations); graph.alterElementVisibility(inMemoryTableElement, mutation.getNewElementVisibility()); EdgeMutation edgeMutation = (EdgeMutation) mutation; if (edgeMutation.getNewEdgeLabel() != null) { graph.alterEdgeLabel((InMemoryTableEdge) inMemoryTableElement, edgeMutation.getAlterEdgeLabelTimestamp(), edgeMutation.getNewEdgeLabel());
@Before public final void clearGraph() { if (graph != null) { graph.shutdown(); graph = null; } graphIdGenerator = null; graphSearchIndex = null; configurationMap = null; graphPropertyWorkerPrepareData = null; user = null; workQueueRepository = null; System.setProperty(ConfigurationLoader.ENV_CONFIGURATION_LOADER, HashMapConfigurationLoader.class.getName()); workQueueNames = new WorkQueueNames(getConfiguration()); InMemoryWorkQueueRepository.clearQueue(); }
public void addPropertyValue(String key, String name, Object value, Metadata metadata, Visibility visibility, Long timestamp, boolean indexAfterAdd, Authorizations authorizations) { getGraph().addPropertyValue(this, inMemoryTableElement, key, name, value, metadata, visibility, timestamp, authorizations); if (indexAfterAdd) { getGraph().getSearchIndex().addElement(getGraph(), this, authorizations); } }
@Override public Authorizations createAuthorizations(String... auths) { addValidAuthorizations(auths); return new InMemoryAuthorizations(auths); }
null ); graph = InMemoryGraph.create(); termMentionAuthorizations = graph.createAuthorizations(TermMentionRepository.VISIBILITY_STRING, VISIBILITY_SOURCE, WORKSPACE_ID); visibility = new Visibility(VISIBILITY_SOURCE); visibilityJson = new VisibilityJson();
@Before public final void clearGraph() { if (graph != null) { graph.shutdown(); graph = null; } graphIdGenerator = null; graphSearchIndex = null; configurationMap = null; graphPropertyWorkerPrepareData = null; user = null; workQueueRepository = null; System.setProperty(ConfigurationLoader.ENV_CONFIGURATION_LOADER, HashMapConfigurationLoader.class.getName()); workQueueNames = new WorkQueueNames(getConfiguration()); InMemoryWorkQueueRepository.clearQueue(); }
@SuppressWarnings("unused") public static InMemoryGraph create() { return create(DEFAULT_CONFIGURATION); }
public static InMemoryGraph create(InMemoryGraphConfiguration config) { InMemoryGraph graph = new InMemoryGraph(config); graph.setup(); return graph; }
@SuppressWarnings("unused") public static InMemoryGraph create(Map<String, Object> config) { return create(new InMemoryGraphConfiguration(config)); }
protected void before() { graph = InMemoryGraph.create(); when(metricsManager.counter(any())).thenReturn(mockCounter); when(metricsManager.counter(any(), any())).thenReturn(mockCounter); when(metricsManager.timer(any())).thenReturn(mockTimer); when(metricsManager.timer(any(), any())).thenReturn(mockTimer); when(metricsManager.meter(any())).thenReturn(mockMeter); when(metricsManager.meter(any(), any())).thenReturn(mockMeter); when(userRepository.getSystemUser()).thenReturn(systemUser); when(authorizationRepository.getGraphAuthorizations(systemUser)).thenReturn(systemUserAuthorizations); }
public void before() { Map config = new HashMap(); ConfigurationLoader hashMapConfigurationLoader = new HashMapConfigurationLoader(config); configuration = new Configuration(hashMapConfigurationLoader, new HashMap<>()); graph = InMemoryGraph.create(getGraphConfiguration()); visibility = new Visibility(""); authorizations = graph.createAuthorizations(""); }
protected Graph getGraph() { if (graph == null) { Map graphConfiguration = getConfigurationMap(); InMemoryGraphConfiguration inMemoryGraphConfiguration = new InMemoryGraphConfiguration(graphConfiguration); graph = InMemoryGraph.create(inMemoryGraphConfiguration, getGraphIdGenerator(), getGraphSearchIndex(inMemoryGraphConfiguration)); } return graph; }
@Override protected Graph createGraph() throws Exception { InMemoryGraphConfiguration configuration = new InMemoryGraphConfiguration(elasticsearchResource.createConfig()); return InMemoryGraph.create(configuration); }
@Before public void before() { graph = InMemoryGraph.create(); authorizations = graph.createAuthorizations(); workQueueRepository = new TestWorkQueueRepository( graph, workQueueNames, configuration ); workQueueRepository.setAuthorizationRepository(authorizationRepository); workQueueRepository.setUserRepository(userRepository); workQueueRepository.setWorkspaceRepository(workspaceRepository); }