@Test public void testIndexNodeUnique() { ColumnStore<Node> columnStore = generateBasicNodeColumnStore(); IndexStore<Node> indexStore = columnStore.indexStore; IndexImpl<Node> mainIndex = indexStore.mainIndex; Column col1 = columnStore.getColumn("foo"); Column col2 = columnStore.getColumn("age"); NodeImpl[] nodes = generateNodesWithUniqueAttributes(columnStore); for (NodeImpl n : nodes) { indexStore.index(n); } Assert.assertEquals(mainIndex.countElements(col1), nodes.length); Assert.assertEquals(mainIndex.countElements(col2), nodes.length); Assert.assertEquals(mainIndex.countValues(col1), nodes.length); Assert.assertEquals(mainIndex.countValues(col2), nodes.length); Assert.assertEquals(mainIndex.values(col1).size(), nodes.length); Assert.assertEquals(mainIndex.values(col2).size(), nodes.length); }
public void index(T element) { ElementImpl elementImpl = (ElementImpl) element; lock(); try { ensureAttributeArrayLength(elementImpl, columnStore.length); final int length = columnStore.length; final ColumnImpl[] cols = columnStore.columns; for (int i = 0; i < length; i++) { Column c = cols[i]; if (c != null && c.isIndexed()) { Object value = elementImpl.attributes[c.getIndex()]; value = mainIndex.put(c, value, element); elementImpl.attributes[c.getIndex()] = value; } } } finally { unlock(); } }
IndexStore { public void index(T element) { ElementImpl elementImpl = (ElementImpl) element; lock(); try { ensureAttributeArrayLength(elementImpl, columnStore.length); final int length = columnStore.length; final ColumnImpl[] cols = columnStore.columns; for (int i = 0; i < length; i++) { Column c = cols[i]; if (c != null && c.isIndexed()) { Object value = elementImpl.attributes[c.getIndex()]; value = mainIndex.put(c, value, element); elementImpl.attributes[c.getIndex()] = value; } } } finally { unlock(); } } }
IndexStore { public void index(T element) { ElementImpl elementImpl = (ElementImpl) element; lock(); try { ensureAttributeArrayLength(elementImpl, columnStore.length); final int length = columnStore.length; final ColumnImpl[] cols = columnStore.columns; for (int i = 0; i < length; i++) { Column c = cols[i]; if (c != null && c.isIndexed()) { Object value = elementImpl.attributes[c.getIndex()]; value = mainIndex.put(c, value, element); elementImpl.attributes[c.getIndex()] = value; } } } finally { unlock(); } } IndexStore(ColumnStore<T> columnStore); }
IndexStore { public void index(T element) { ElementImpl elementImpl = (ElementImpl) element; lock(); try { ensureAttributeArrayLength(elementImpl, columnStore.length); final int length = columnStore.length; final ColumnImpl[] cols = columnStore.columns; for (int i = 0; i < length; i++) { Column c = cols[i]; if (c != null && c.isIndexed()) { Object value = elementImpl.attributes[c.getIndex()]; value = mainIndex.put(c, value, element); elementImpl.attributes[c.getIndex()] = value; } } } finally { unlock(); } } 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 { public void index(T element) { ElementImpl elementImpl = (ElementImpl) element; lock(); try { ensureAttributeArrayLength(elementImpl, columnStore.length); final int length = columnStore.length; final ColumnImpl[] cols = columnStore.columns; for (int i = 0; i < length; i++) { Column c = cols[i]; if (c != null && c.isIndexed()) { Object value = elementImpl.attributes[c.getIndex()]; value = mainIndex.put(c, value, element); elementImpl.attributes[c.getIndex()] = value; } } } finally { unlock(); } } 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();  }