public long rebuild() { return delegate.rebuild(); }
public long rebuild(final OProgressListener iProgressListener) { return delegate.rebuild(iProgressListener); }
@Override public void onClick(Optional<AjaxRequestTarget> targetOptional) { OIndex<?> oIndex = oIndexModel.getObject(); oIndex.rebuild(); getPage().success(getLocalizer().getString("success.complete.rebuild", this)); }
@Override public void reindex() { OrientGraph tx = txProvider.rawTx(); try { OIndexManager manager = tx.getRawGraph().getMetadata().getIndexManager(); manager.getIndexes().forEach(i -> i.rebuild()); } finally { tx.shutdown(); } }
/** * Execute the REMOVE INDEX. */ public Object execute(final Map<Object, Object> iArgs) { if (name == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); final ODatabaseDocument database = getDatabase(); if (name.equals("*")) { long totalIndexed = 0; for (OIndex<?> idx : database.getMetadata().getIndexManager().getIndexes()) { if (idx.isAutomatic()) totalIndexed += idx.rebuild(); } return totalIndexed; } else { final OIndex<?> idx = database.getMetadata().getIndexManager().getIndex(name); if (idx == null) throw new OCommandExecutionException("Index '" + name + "' not found"); if (!idx.isAutomatic()) throw new OCommandExecutionException("Cannot rebuild index '" + name + "' because it's manual and there aren't indications of what to index"); return idx.rebuild(); } }
protected void truncateClusterInternal(final String clusterName, final ODatabaseDocumentInternal database) { final OCluster cluster = database.getStorage().getClusterByName(clusterName); if (cluster == null) { throw new ODatabaseException("Cluster with name " + clusterName + " does not exist"); } try { database.checkForClusterPermissions(clusterName); cluster.truncate(); } catch (IOException e) { throw OException.wrapException(new ODatabaseException("Error during truncate of cluster " + clusterName), e); } for (OIndex index : getIndexes()) { index.rebuild(); } }
superclassIndexes.removeAll(getClassIndexes()); for (OIndex index : superclassIndexes) { index.rebuild();
@Override public OResultSet executeSimple(OCommandContext ctx) { OResultInternal result = new OResultInternal(); result.setProperty("operation", "rebuild index"); final ODatabaseDocument database = getDatabase(); if (all) { long totalIndexed = 0; for (OIndex<?> idx : database.getMetadata().getIndexManager().getIndexes()) { if (idx.isAutomatic()) totalIndexed += idx.rebuild(); } result.setProperty("totalIndexed", totalIndexed); } else { final OIndex<?> idx = database.getMetadata().getIndexManager().getIndex(name.getValue()); if (idx == null) throw new OCommandExecutionException("Index '" + name + "' not found"); if (!idx.isAutomatic()) throw new OCommandExecutionException( "Cannot rebuild index '" + name + "' because it's manual and there aren't indications of what to index"); long val = idx.rebuild(); result.setProperty("totalIndexed", val); } OInternalResultSet rs = new OInternalResultSet(); rs.add(result); return rs; }
database.getMetadata().getIndexManager().getIndex(indexName).rebuild(new OProgressListener() { private long last = 0;