mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-30 02:13:33 -04:00
Adjust Transport client settings and plugins
This commit is contained in:
parent
bf72c02644
commit
a51955f3b5
2 changed files with 21 additions and 13 deletions
|
@ -237,15 +237,11 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Rep
|
|||
|
||||
@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(
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
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;
|
||||
|
@ -31,13 +32,11 @@ 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() {
|
||||
|
@ -46,13 +45,19 @@ public abstract class BaseSearchableSnapshotsIntegTestCase extends ESIntegTestCa
|
|||
|
||||
@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(),
|
||||
|
@ -71,4 +76,11 @@ public abstract class BaseSearchableSnapshotsIntegTestCase extends ESIntegTestCa
|
|||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue