private IndexIdentifier(TitanIndex index) { Preconditions.checkArgument(index != null); indexName = index.name(); if (index instanceof RelationTypeIndex) relationTypeName = ((RelationTypeIndex) index).getType().name(); else relationTypeName = null; Preconditions.checkArgument(StringUtils.isNotBlank(indexName)); hashcode = new HashCodeBuilder().append(indexName).append(relationTypeName).hashCode(); }
,indexName); Preconditions.checkArgument(idx!=null,"Index could not be found: %s @ %s",indexName,relationTypeName); isStable = idx.getIndexStatus().isStable(); } else { TitanGraphIndex idx = mgmt.getGraphIndex(indexName);
final String name1n = name1.name(), connect1n = connect1.name(), connect2n = connect2.name(), connect3n = connect3.name(), child1n = child1.name(), link1n = link1.name(); assertTrue(mgmt.containsRelationIndex(connect, "weightDesc")); assertFalse(mgmt.containsRelationIndex(child, "weightDesc")); assertEquals("time+weight", mgmt.getRelationIndex(connect, "time+weight").name()); assertNotNull(mgmt.getRelationIndex(link, "time")); assertNull(mgmt.getRelationIndex(name, "time")); assertTrue(mgmt.containsRelationIndex(connect, "weightDesc")); assertFalse(mgmt.containsRelationIndex(child, "weightDesc")); assertEquals("time+weight", mgmt.getRelationIndex(connect, "time+weight").name()); assertNotNull(mgmt.getRelationIndex(link, "time")); assertNull(mgmt.getRelationIndex(name, "time"));
final String name1n = name1.getName(), connect1n = connect1.getName(), connect2n = connect2.getName(), connect3n = connect3.getName(), child1n = child1.getName(), link1n = link1.getName(); assertTrue(mgmt.containsRelationIndex(connect,"weightDesc")); assertFalse(mgmt.containsRelationIndex(child,"weightDesc")); assertEquals("time+weight",mgmt.getRelationIndex(connect,"time+weight").getName()); assertNotNull(mgmt.getRelationIndex(link,"time")); assertNull(mgmt.getRelationIndex(name,"time")); assertTrue(mgmt.containsRelationIndex(connect,"weightDesc")); assertFalse(mgmt.containsRelationIndex(child, "weightDesc")); assertEquals("time+weight",mgmt.getRelationIndex(connect,"time+weight").getName()); assertNotNull(mgmt.getRelationIndex(link, "time")); assertNull(mgmt.getRelationIndex(name, "time"));
final String relationTypeName = RelationTypeIndex.class.isAssignableFrom(index.getClass()) ? ((RelationTypeIndex)index).getType().name() : ""; Preconditions.checkNotNull(indexName);
mgmt = g.openManagement(); idx = mgmt.getRelationIndex(mgmt.getRelationType(relationTypeName), relationIndexName); actualStatus = idx.getIndexStatus(); LOGGER.info("Index {} (relation type {}) has status {}", relationIndexName, relationTypeName, actualStatus); if (status.equals(actualStatus)) {
private IndexIdentifier(TitanIndex index) { Preconditions.checkArgument(index != null); indexName = index.name(); if (index instanceof RelationTypeIndex) relationTypeName = ((RelationTypeIndex) index).getType().name(); else relationTypeName = null; Preconditions.checkArgument(StringUtils.isNotBlank(indexName)); hashcode = new HashCodeBuilder().append(indexName).append(relationTypeName).hashCode(); }
eindex = mgmt.getRelationIndex(mgmt.getRelationType("friend"), "byTime"); gindex = mgmt.getGraphIndex("bySensorReading"); assertEquals(SchemaStatus.REGISTERED, pindex.getIndexStatus()); assertEquals(SchemaStatus.REGISTERED, eindex.getIndexStatus()); assertEquals(SchemaStatus.REGISTERED, gindex.getIndexStatus(gindex.getFieldKeys()[0])); finishSchema(); eindex = mgmt.getRelationIndex(mgmt.getRelationType("friend"), "byTime"); gindex = mgmt.getGraphIndex("bySensorReading"); assertEquals(SchemaStatus.ENABLED, eindex.getIndexStatus()); assertEquals(SchemaStatus.ENABLED, pindex.getIndexStatus()); assertEquals(SchemaStatus.ENABLED, gindex.getIndexStatus(gindex.getFieldKeys()[0])); assertEquals(SchemaStatus.DISABLED, pindex.getIndexStatus()); assertEquals(SchemaStatus.DISABLED, gindex.getIndexStatus(gindex.getFieldKeys()[0])); finishSchema();
final String relationTypeName = RelationTypeIndex.class.isAssignableFrom(index.getClass()) ? ((RelationTypeIndex)index).getType().name() : ""; Preconditions.checkNotNull(indexName);
,indexName); Preconditions.checkArgument(idx!=null,"Index could not be found: %s @ %s",indexName,relationTypeName); isStable = idx.getIndexStatus().isStable(); } else { TitanGraphIndex idx = mgmt.getGraphIndex(indexName);
mgmt = g.openManagement(); idx = mgmt.getRelationIndex(mgmt.getRelationType(relationTypeName), relationIndexName); actualStatus = idx.getIndexStatus(); LOGGER.info("Index {} (relation type {}) has status {}", relationIndexName, relationTypeName, actualStatus); if (status.equals(actualStatus)) {