Package org.elasticsearch.node.settings

Examples of org.elasticsearch.node.settings.NodeSettingsService


        when(indexService.shardSafe(1)).thenReturn(shard1Injector.getInstance(IndexShard.class));
        when(indicesService.indexServiceSafe(TEST_TABLE_NAME)).thenReturn(indexService);



        NodeSettingsService nodeSettingsService = mock(NodeSettingsService.class);

        operation = new MapSideDataCollectOperation(
                injector.getInstance(ClusterService.class),
                ImmutableSettings.EMPTY,
                mock(TransportActionProvider.class, Answers.RETURNS_DEEP_STUBS.get()),
View Full Code Here


            public ReferenceImplementation getImplementation(ReferenceIdent ident) {
                return null;
            }
        };

        NodeSettingsService nodeSettingsService = mock(NodeSettingsService.class);
        MapSideDataCollectOperation collectOperation = new MapSideDataCollectOperation(
                clusterService,
                ImmutableSettings.EMPTY,
                mock(TransportActionProvider.class, Answers.RETURNS_DEEP_STUBS.get()),
                functions,
View Full Code Here

public class StatsTablesTest {


    @Test
    public void testSettingsChanges() {
        NodeSettingsService nodeSettingsService = new NodeSettingsService(ImmutableSettings.EMPTY);
        StatsTables stats = new StatsTables(ImmutableSettings.EMPTY, nodeSettingsService);

        assertThat(stats.isEnabled(), is(false));
        assertThat(stats.lastJobsLogSize, is(CrateSettings.STATS_JOBS_LOG_SIZE.defaultValue()));
        assertThat(stats.lastOperationsLogSize, is(CrateSettings.STATS_OPERATIONS_LOG_SIZE.defaultValue()));
View Full Code Here

        assertThat(stats.isEnabled(), is(false));
    }

    @Test
    public void testLogsArentWipedOnSizeChange() {
        NodeSettingsService nodeSettingsService = new NodeSettingsService(ImmutableSettings.EMPTY);
        Settings settings = ImmutableSettings.builder()
                .put(CrateSettings.STATS_ENABLED.settingName(), true).build();
        StatsTables stats = new StatsTables(settings, nodeSettingsService);

        stats.jobsLog.get().add(new JobContextLog(new JobContext(UUID.randomUUID(), "select 1", 1L), null));
View Full Code Here

    public DiskThresholdDecider(Settings settings) {
        // It's okay the Client is null here, because the empty cluster info
        // service will never actually call the listener where the client is
        // needed. Also this constructor is only used for tests
        this(settings, new NodeSettingsService(settings), ClusterInfoService.EMPTY, null);
    }
View Full Code Here

     * Creates a new {@link AwarenessAllocationDecider} instance from given settings
     *
     * @param settings {@link Settings} to use
     */
    public AwarenessAllocationDecider(Settings settings) {
        this(settings, new NodeSettingsService(settings));
    }
View Full Code Here

    private volatile float threshold = 1.0f;


    public BalancedShardsAllocator(Settings settings) {
        this(settings, new NodeSettingsService(settings));
    }
View Full Code Here

     * Creates a new {@link org.elasticsearch.cluster.routing.allocation.decider.SnapshotInProgressAllocationDecider} instance from given settings
     *
     * @param settings {@link org.elasticsearch.common.settings.Settings} to use
     */
    public SnapshotInProgressAllocationDecider(Settings settings) {
        this(settings, new NodeSettingsService(settings));
    }
View Full Code Here

        settings.put(BalancedShardsAllocator.SETTING_INDEX_BALANCE_FACTOR, 0.2);
        settings.put(BalancedShardsAllocator.SETTING_SHARD_BALANCE_FACTOR, 0.3);
        settings.put(BalancedShardsAllocator.SETTING_PRIMARY_BALANCE_FACTOR, 0.5);
        settings.put(BalancedShardsAllocator.SETTING_THRESHOLD, 2.0);
        final NodeSettingsService.Listener[] listeners = new NodeSettingsService.Listener[1];
        NodeSettingsService service = new NodeSettingsService(settingsBuilder().build()) {

            @Override
            public void addListener(Listener listener) {
                assertNull("addListener was called twice while only one time was expected", listeners[0]);
                listeners[0] = listener;
View Full Code Here

    @Test
    public void testNoRebalanceOnPrimaryOverload() {
        ImmutableSettings.Builder settings = settingsBuilder();
        AllocationService strategy = new AllocationService(settings.build(), randomAllocationDeciders(settings.build(),
                new NodeSettingsService(ImmutableSettings.Builder.EMPTY_SETTINGS), getRandom()), new ShardsAllocators(settings.build(),
                new NoneGatewayAllocator(), new ShardsAllocator() {

            @Override
            public boolean rebalance(RoutingAllocation allocation) {
                return false;
View Full Code Here

TOP

Related Classes of org.elasticsearch.node.settings.NodeSettingsService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.