コード例 #1
0
ファイル: Optimize.java プロジェクト: james-jw/basex
  /**
   * Creates or deletes the specified index if the old and new state is different.
   *
   * @param type index type
   * @param data data reference
   * @param create new flag
   * @param old old flag
   * @param enforce enforce operation
   * @param cmd calling command instance
   * @throws IOException I/O exception
   */
  private static void optimize(
      final IndexType type,
      final Data data,
      final boolean create,
      final boolean old,
      final boolean enforce,
      final Optimize cmd)
      throws IOException {

    // check if flags have changed
    if (create == old && !enforce) return;

    // create or drop index
    if (create) CreateIndex.create(type, data, cmd);
    else DropIndex.drop(type, data);
  }
コード例 #2
0
 public void visit(DropIndex entity) {
   wGetVisitor1().visit(entity.getIndexName());
 }