private void distributedDropIndex(final String iName) { String dropIndexDDL = "DROP INDEX `" + iName + "`"; //noinspection deprecation getDatabase().command(new OCommandSQL(dropIndexDDL)).execute(); ORecordInternal .setIdentity(delegate.getDocument(), new ORecordId(getDatabase().getStorage().getConfiguration().getIndexMgrRecordId())); reload(); }
private OIndex<?> distributedCreateIndex(final String iName, final String iType, final OIndexDefinition iIndexDefinition, final OProgressListener progressListener, ODocument metadata, String engine) { String createIndexDDL; if (iIndexDefinition != null) createIndexDDL = iIndexDefinition.toCreateIndexDDL(iName, iType, engine); else createIndexDDL = new OSimpleKeyIndexDefinition().toCreateIndexDDL(iName, iType, engine); if (metadata != null) createIndexDDL += " " + OCommandExecutorSQLCreateIndex.KEYWORD_METADATA + " " + metadata.toJSON(); if (progressListener != null) progressListener.onBegin(this, 0, false); //noinspection deprecation getDatabase().command(new OCommandSQL(createIndexDDL)).execute(); ORecordInternal .setIdentity(delegate.getDocument(), new ORecordId(getDatabase().getStorage().getConfiguration().getIndexMgrRecordId())); if (progressListener != null) progressListener.onCompletition(this, true); reload(); return delegate.preProcessBeforeReturn(getDatabase(), delegate.getIndex(iName)); }