Example #1
0
  /**
   * Creates new node ids and recreates updatable index structures.
   *
   * @param data data
   * @throws IOException I/O Exception during index rebuild
   */
  public static void ids(final Data data) throws IOException {
    final MetaData md = data.meta;
    final int size = md.size;
    for (int pre = 0; pre < size; ++pre) data.id(pre, pre);
    md.lastid = size - 1;
    md.dirty = true;

    if (data.meta.updindex) {
      data.idmap = new IdPreMap(md.lastid);
      if (data.meta.textindex) optimize(IndexType.TEXT, data, true, true, true, null);
      if (data.meta.attrindex) optimize(IndexType.ATTRIBUTE, data, true, true, true, null);
    }
  }