summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/prelude/fastsearch/ClusterParams.java
blob: 8e6a70b8c78ec51acee1e9ed5f79ac71b3ab7d2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.fastsearch;

import com.yahoo.container.search.LegacyEmulationConfig;

/**
 * Helper class for carrying around cluster-related
 * config parameters to the FastSearcher class.
 *
 * @author arnej27959
 */
public class ClusterParams {
    public final int clusterNumber;
    public final String searcherName;
    public final int rowBits;
    public final LegacyEmulationConfig emulation;

    /**
     * for compatibility
     **/
    public ClusterParams(int number, String name, int rowbits) {
        this(number, name, rowbits, new LegacyEmulationConfig(new LegacyEmulationConfig.Builder()));
    }

    /**
     * for testcases only
     **/
    public ClusterParams(String name) {
        this(0, name, 0);
    }

    /**
     * make up full ClusterParams
     **/
    public ClusterParams(int number, String name, int rowbits, LegacyEmulationConfig cfg) {
        this.clusterNumber = number;
        this.searcherName = name;
        this.rowBits = rowbits;
        this.emulation = cfg;
    }

}