Move general index classes from gerrit-server to gerrit-index

These classes do not depend on any Gerrit server functionality, and
could even be used to define an index without depending on the
gerrit-server package. This allows for a clearer separation of BUILD
rules; the QueryParser and antlr targets don't escape the gerrit-index
package.

The general layout thus far is to put index definition code in
com.google.gerrit.index, and query-related code (predicates, etc.)  in
com.google.gerrit.index.query.

The gerrit-index package is still of limited utility on its own, because
QueryProcessor and InternalQuery still live in the server package, and
untangling their dependencies will still be a bit more work.

Change-Id: I3c4616d08ecf19d5ccd1b9b91b3fd0b1fcedd901
This commit is contained in:
Dave Borowitz
2017-08-08 09:53:39 -04:00
parent 94f077b5d2
commit e47be68709
156 changed files with 424 additions and 363 deletions

View File

@@ -0,0 +1,23 @@
// Copyright (C) 2016 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.index;
import com.google.gerrit.index.query.Predicate;
import com.google.gerrit.index.query.QueryParseException;
public interface IndexRewriter<T> {
Predicate<T> rewrite(Predicate<T> in, QueryOptions opts) throws QueryParseException;
}