Skip to content

Merge feature/searchable-snapshots branch into 7.x (#54803) #54825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 7, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,11 @@ && isSearchableSnapshotStore(indexSettings.getSettings())

@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) {
return org.elasticsearch.common.collect.List.of(
new ActionHandler<>(SearchableSnapshotsStatsAction.INSTANCE, TransportSearchableSnapshotsStatsAction.class),
new ActionHandler<>(ClearSearchableSnapshotsCacheAction.INSTANCE, TransportClearSearchableSnapshotsCacheAction.class),
new ActionHandler<>(MountSearchableSnapshotAction.INSTANCE, TransportMountSearchableSnapshotAction.class)
);
} else {
return emptyList();
}
return org.elasticsearch.common.collect.List.of(
new ActionHandler<>(SearchableSnapshotsStatsAction.INSTANCE, TransportSearchableSnapshotsStatsAction.class),
new ActionHandler<>(ClearSearchableSnapshotsCacheAction.INSTANCE, TransportClearSearchableSnapshotsCacheAction.class),
new ActionHandler<>(MountSearchableSnapshotAction.INSTANCE, TransportMountSearchableSnapshotAction.class)
);
}

public List<RestHandler> getRestHandlers(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@
*/
package org.elasticsearch.xpack.searchablesnapshots;

import org.elasticsearch.common.collect.List;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.license.LicenseService;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin;
import org.elasticsearch.xpack.core.XPackSettings;
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;

import java.util.Collection;

import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList;

public abstract class BaseSearchableSnapshotsIntegTestCase extends ESIntegTestCase {
@Override
protected boolean addMockInternalEngine() {
Expand All @@ -46,13 +45,19 @@ protected boolean addMockInternalEngine() {

@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return unmodifiableList(asList(SearchableSnapshots.class, LocalStateCompositeXPackPlugin.class));
return List.of(SearchableSnapshots.class, LocalStateCompositeXPackPlugin.class);
}

@Override
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
return nodePlugins();
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
final Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
builder.put(XPackSettings.SECURITY_ENABLED.getKey(), false);
if (randomBoolean()) {
builder.put(
CacheService.SNAPSHOT_CACHE_SIZE_SETTING.getKey(),
Expand All @@ -71,4 +76,11 @@ protected Settings nodeSettings(int nodeOrdinal) {
}
return builder.build();
}

@Override
protected Settings transportClientSettings() {
final Settings.Builder builder = Settings.builder().put(super.transportClientSettings());
builder.put(XPackSettings.SECURITY_ENABLED.getKey(), false);
return builder.build();
}
}