Search in sources :

Example 1 with Netty4Plugin

use of org.elasticsearch.transport.Netty4Plugin in project sonarqube by SonarSource.

the class EsTester method startNode.

private static Node startNode(Path tempDir, int httpPort) throws NodeValidationException {
    Settings settings = Settings.builder().put(Environment.PATH_HOME_SETTING.getKey(), tempDir).put("node.name", "EsTester").put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), Integer.MAX_VALUE).put("logger.level", "INFO").put("action.auto_create_index", false).put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), "1b").put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), "1b").put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey(), "1b").put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY_STATE_SYNC_SETTING.getKey(), TimeValue.timeValueMillis(20)).put(HttpTransportSettings.SETTING_HTTP_PORT.getKey(), httpPort).put(HttpTransportSettings.SETTING_HTTP_BIND_HOST.getKey(), "localhost").put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), "single-node").build();
    Node node = new Node(InternalSettingsPreparer.prepareEnvironment(settings, Collections.emptyMap(), null, null), ImmutableList.of(CommonAnalysisPlugin.class, // Netty4Plugin provides http and tcp transport
    Netty4Plugin.class, // install ParentJoin plugin required to create field of type "join"
    ParentJoinPlugin.class), true) {
    };
    return node.start();
}
Also used : Netty4Plugin(org.elasticsearch.transport.Netty4Plugin) Node(org.elasticsearch.node.Node) ParentJoinPlugin(org.elasticsearch.join.ParentJoinPlugin) CommonAnalysisPlugin(org.elasticsearch.analysis.common.CommonAnalysisPlugin) RecoverySettings(org.elasticsearch.indices.recovery.RecoverySettings) Settings(org.elasticsearch.common.settings.Settings) HttpTransportSettings(org.elasticsearch.http.HttpTransportSettings) DiskThresholdSettings(org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings)

Aggregations

CommonAnalysisPlugin (org.elasticsearch.analysis.common.CommonAnalysisPlugin)1 DiskThresholdSettings (org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings)1 Settings (org.elasticsearch.common.settings.Settings)1 HttpTransportSettings (org.elasticsearch.http.HttpTransportSettings)1 RecoverySettings (org.elasticsearch.indices.recovery.RecoverySettings)1 ParentJoinPlugin (org.elasticsearch.join.ParentJoinPlugin)1 Node (org.elasticsearch.node.Node)1 Netty4Plugin (org.elasticsearch.transport.Netty4Plugin)1