aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main/java/com/yahoo/searchlib/aggregation/ForceLoad.java
blob: 74d498d33f72d448bc621020f30d467dfb6018aa (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.aggregation;

/**
 * FIXME: Really ugly hack to force class loading for subclasses of Identifiable.
 * This should be fixed by doing the all class registration in a single place (similar to how its done in C++).
 */
public class ForceLoad {

    static {
        String pkg = "com.yahoo.searchlib.aggregation";
        String[] classes = {
                "XorAggregationResult",
                "SumAggregationResult",
                "Group",
                "HitsAggregationResult",
                "AggregationResult",
                "FS4Hit",
                "VdsHit",
                "Grouping",
                "Hit",
                "MinAggregationResult",
                "GroupingLevel",
                "MaxAggregationResult",
                "CountAggregationResult",
                "AverageAggregationResult",
                "ExpressionCountAggregationResult",
                "hll.SparseSketch",
                "hll.NormalSketch"
        };
        com.yahoo.system.ForceLoad.forceLoad(pkg, classes, ForceLoad.class.getClassLoader());
    }

    public static boolean forceLoad() {
        return true;
    }

}