@Test public void testClearElementWithView() { GraphStore graphStore = generateBasicGraphStoreWithColumns(); GraphView view = graphStore.viewStore.createView(); Graph graph = graphStore.viewStore.getGraph(view); Column column = graphStore.nodeTable.store.getColumn("foo"); Node n1 = graphStore.factory.newNode("1"); n1.setAttribute(column, "bar"); graphStore.addNode(n1); graph.addNode(n1); IndexStore<Node> indexStore = graphStore.nodeTable.store.indexStore; IndexImpl index = indexStore.createViewIndex(graphStore.viewStore.getGraph(view)); n1.clearAttributes(); Assert.assertEquals(index.countElements(column), 0); Assert.assertEquals(index.countValues(column), 0); Assert.assertEquals(index.count(column, "bar"), 0); }
protected IndexImpl createViewIndex(Graph graph) { if (graph.getView().isMainView()) { throw new IllegalArgumentException("Can't create a view index for the main view"); } IndexImpl viewIndex = new IndexImpl<T>(columnStore); ColumnImpl[] columns = columnStore.toArray(); viewIndex.addAllColumns(columns); viewIndexes.put(graph.getView(), viewIndex); indexView(graph); return viewIndex; }
IndexStore { protected IndexImpl createViewIndex(Graph graph) { if (graph.getView().isMainView()) { throw new IllegalArgumentException("Can't create a view index for the main view"); } IndexImpl viewIndex = new IndexImpl<T>(columnStore); ColumnImpl[] columns = columnStore.toArray(); viewIndex.addAllColumns(columns); viewIndexes.put(graph.getView(), viewIndex); indexView(graph); return viewIndex; } }
IndexStore { protected IndexImpl createViewIndex(Graph graph) { if (graph.getView().isMainView()) { throw new IllegalArgumentException("Can't create a view index for the main view"); } IndexImpl viewIndex = new IndexImpl<T>(columnStore); ColumnImpl[] columns = columnStore.toArray(); viewIndex.addAllColumns(columns); viewIndexes.put(graph.getView(), viewIndex); indexView(graph); return viewIndex; } IndexStore(ColumnStore<T> columnStore); }
IndexStore { protected IndexImpl createViewIndex(Graph graph) { if (graph.getView().isMainView()) { throw new IllegalArgumentException("Can't create a view index for the main view"); } IndexImpl viewIndex = new IndexImpl<T>(columnStore); ColumnImpl[] columns = columnStore.toArray(); viewIndex.addAllColumns(columns); viewIndexes.put(graph.getView(), viewIndex); indexView(graph); return viewIndex; } IndexStore(ColumnStore<T> columnStore); Object set(Column column, Object oldValue, Object value, T element); void clear(T element); void index(T element); void indexView(Graph graph); void indexInView(T element, GraphView view); void clearInView(T element, GraphView view); void clear(GraphView view); void clear(); }
IndexStore { protected IndexImpl createViewIndex(Graph graph) { if (graph.getView().isMainView()) { throw new IllegalArgumentException("Can't create a view index for the main view"); } IndexImpl viewIndex = new IndexImpl<T>(columnStore); ColumnImpl[] columns = columnStore.toArray(); viewIndex.addAllColumns(columns); viewIndexes.put(graph.getView(), viewIndex); indexView(graph); return viewIndex; } IndexStore(ColumnStore<T> columnStore); Object set(Column column, Object oldValue, Object value, T element); void clear(T element); void index(T element); void indexView(Graph graph); void indexInView(T element, GraphView view); void clearInView(T element, GraphView view); void clear(GraphView view); void clear();  }