Class IndexUtils

java.lang.Object
com.google.gerrit.server.index.IndexUtils

public final class IndexUtils extends Object
Set of index-related utility methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Set<String>
    accountFields(QueryOptions opts, boolean useLegacyNumericFields)
    Returns a sanitized set of fields for account index queries by removing fields that the current index version doesn't support and accounting for numeric vs.
    static Set<String>
    accountFields(Set<String> fields, boolean useLegacyNumericFields)
    Returns a sanitized set of fields for account index queries by removing fields that the current index version doesn't support and accounting for numeric vs.
    static Set<String>
    Returns a sanitized set of fields for change index queries by removing fields that the current index version doesn't support.
    static String
    Returns a index-friendly representation of a CurrentUser to be used in queries.
    static Set<String>
    Returns a sanitized set of fields for group index queries by removing fields that the index doesn't support and accounting for numeric vs.
    static Set<String>
    Returns a sanitized set of fields for project index queries by removing fields that the index doesn't support.
    static void
    setReady(SitePaths sitePaths, String name, int version, boolean ready)
    Mark an index version as ready to serve queries.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • setReady

      public static void setReady(SitePaths sitePaths, String name, int version, boolean ready)
      Mark an index version as ready to serve queries.
    • accountFields

      public static Set<String> accountFields(QueryOptions opts, boolean useLegacyNumericFields)
      Returns a sanitized set of fields for account index queries by removing fields that the current index version doesn't support and accounting for numeric vs. string primary keys. The primary key situation is temporary and should be removed after the migration is done.
    • accountFields

      public static Set<String> accountFields(Set<String> fields, boolean useLegacyNumericFields)
      Returns a sanitized set of fields for account index queries by removing fields that the current index version doesn't support and accounting for numeric vs. string primary keys. The primary key situation is temporary and should be removed after the migration is done.
    • changeFields

      public static Set<String> changeFields(QueryOptions opts)
      Returns a sanitized set of fields for change index queries by removing fields that the current index version doesn't support.
    • groupFields

      public static Set<String> groupFields(QueryOptions opts)
      Returns a sanitized set of fields for group index queries by removing fields that the index doesn't support and accounting for numeric vs. string primary keys. The primary key situation is temporary and should be removed after the migration is done.
    • describe

      public static String describe(CurrentUser user)
      Returns a index-friendly representation of a CurrentUser to be used in queries.
    • projectFields

      public static Set<String> projectFields(QueryOptions opts)
      Returns a sanitized set of fields for project index queries by removing fields that the index doesn't support.