public boolean isRollUpCombinationSupported(final Set<String> rolledUpFieldNames) {
        if (rolledUpFieldNames == null || rolledUpFieldNames.isEmpty()) {
            return true;
        }

        if (rolledUpFieldNames.size() > fields.size()) {
            throw new RuntimeException("isRollUpCombinationSupported called with more rolled up fields (" +
                    rolledUpFieldNames + ") than there are statistic fields (" +
                    getCachedFieldPositions().keySet() + ")");
        }

        if (!getCachedFieldPositions().keySet().containsAll(rolledUpFieldNames)) {
            throw new RuntimeException("isRollUpCombinationSupported called rolled up fields (" +
                    rolledUpFieldNames + ") that don't exist in the statistic fields list (" +
                    getCachedFieldPositions().keySet() + ")");
        }

        final List<Integer> rolledUpFieldPositions = new ArrayList<>();
        for (final String rolledUpField : rolledUpFieldNames) {
            rolledUpFieldPositions.add(getFieldPositionInList(rolledUpField));
        }

        return customRollUpMasks.contains(new CustomRollUpMask(rolledUpFieldPositions));
    }
Cache the positions of the fields.
stroom-core-shared/src/main/java/stroom/statistics/impl/hbase/shared/StroomStatsStoreEntityData.java