public <T extends Element> Index<T> createIndex(final String indexName, final Class<T> indexClass, final Parameter... indexParameters) { if (this.indices.containsKey(indexName)) throw ExceptionFactory.indexAlreadyExists(indexName); final TinkerIndex index = new TinkerIndex(indexName, indexClass); this.indices.put(index.getIndexName(), index); return index; }
public <T extends Element> Index<T> createIndex(String indexName, Class<T> indexClass) { for (Index<?> index : getIndices()) { if (index.getIndexName().equals(indexName)) { throw ExceptionFactory.indexAlreadyExists(indexName); } } writeIndexNameEntry(indexName, indexClass); return new AccumuloIndex<T>(globals, indexName, indexClass); }
public <T extends Element> Index<T> createIndex(String indexName, Class<T> indexClass) { for (Index<?> index : getIndices()) { if (index.getIndexName().equals(indexName)) { throw ExceptionFactory.indexAlreadyExists(indexName); } } writeIndexNameEntry(indexName, indexClass); return new AccumuloIndex<T>(globals, indexName, indexClass); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public <T extends Element> Index<T> createIndex(final String indexName, final Class<T> indexClass, final Parameter... indexParameters) { final OrientGraphContext context = getContext(true); commitAnyActiveTx("create index '" + indexName + "'"); synchronized (contexts) { if (context.manualIndices.containsKey(indexName)) throw ExceptionFactory.indexAlreadyExists(indexName); final OrientIndex<? extends OrientElement> index = new OrientIndex<OrientElement>( this, indexName, indexClass, null); // ADD THE INDEX IN ALL CURRENT CONTEXTS for (OrientGraphContext ctx : contexts) ctx.manualIndices.put(index.getIndexName(), index); // SAVE THE CONFIGURATION INTO THE GLOBAL CONFIG saveIndexConfiguration(); return (Index<T>) index; } }
@SuppressWarnings("rawtypes") @Override public <T extends Element> Index<T> createIndex(String indexName, Class<T> indexClass, Parameter... indexParameters) { if (indexClass == null) { throw ExceptionFactory.classForElementCannotBeNull(); } else if (globals.getConfig().getIndexableGraphDisabled()) { throw new UnsupportedOperationException("IndexableGraph is disabled via the configuration"); } for (Index<?> index : globals.getIndexMetadataWrapper().getIndices()) { if (index.getIndexName().equals(indexName)) { throw ExceptionFactory.indexAlreadyExists(indexName); } } return globals.getIndexMetadataWrapper().createIndex(indexName, indexClass); }
@SuppressWarnings("rawtypes") @Override public <T extends Element> Index<T> createIndex(String indexName, Class<T> indexClass, Parameter... indexParameters) { if (indexClass == null) { throw ExceptionFactory.classForElementCannotBeNull(); } else if (globals.getConfig().getIndexableGraphDisabled()) { throw new UnsupportedOperationException("IndexableGraph is disabled via the configuration"); } for (Index<?> index : globals.getIndexMetadataWrapper().getIndices()) { if (index.getIndexName().equals(indexName)) { throw ExceptionFactory.indexAlreadyExists(indexName); } } return globals.getIndexMetadataWrapper().createIndex(indexName, indexClass); }
com.sparsity.sparksee.gdb.Attribute adata = rawGraph.getAttribute(attr); if (adata.getKind() != AttributeKind.Basic) { throw ExceptionFactory.indexAlreadyExists(label + " " + key);
public Index<T> call(final OrientBaseGraph g) { final OIndexManager indexManager = getDatabase().getMetadata().getIndexManager(); if (indexManager.getIndex(indexName) != null) throw ExceptionFactory.indexAlreadyExists(indexName); final OrientIndex<? extends OrientElement> index = new OrientIndex<OrientElement>(g, indexName, indexClass, null); // SAVE THE CONFIGURATION INTO THE GLOBAL CONFIG saveIndexConfiguration(); return (Index<T>) index; } }, "create index '", indexName, "'");
public synchronized <T extends Element> Index<T> createIndex(final String indexName, final Class<T> indexClass, final Parameter... indexParameters) { this.autoStartTransaction(true); if (this.rawGraph.index().existsForNodes(indexName) || this.rawGraph.index().existsForRelationships(indexName)) { throw ExceptionFactory.indexAlreadyExists(indexName); } return new Neo4j2Index(indexName, indexClass, this, indexParameters); }