Don't require secondary index when running daemon in slave mode

Add a dummy index implementation and install it when the daemon is
started in slave mode.

Make the reindex program exit with an error if run on a server that
is configured to run in slave mode.

Disable the query ssh command when in slave mode.

Change-Id: Ia323d7dfc3b8f333857ba310072e41943878c11b
This commit is contained in:
David Pursehouse
2014-09-04 22:23:53 +09:00
parent dcd2fd364e
commit 85f97710d3
5 changed files with 102 additions and 6 deletions

View File

@@ -0,0 +1,26 @@
// Copyright (C) 2014 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.server.index;
import com.google.inject.AbstractModule;
public class DummyIndexModule extends AbstractModule {
@Override
protected void configure() {
install(new IndexModule(1));
bind(ChangeIndex.class).toInstance(new DummyIndex());
}
}