public PersistenceEngine.PersistenceFactory build(ModelElement clusterElem, ContentCluster c) {
        ModelElement persistence = clusterElem.child("engine");
        if (persistence != null) {
            if (c.getSearch().hasIndexed() && persistence.child("proton") == null) {
                throw new IllegalArgumentException("Persistence engine does not allow for indexed search. Please use <proton> as your engine.");
            }

            if (persistence.child("proton") != null) {
                return new ProtonEngine.Factory(c.getSearch());
            } else if (persistence.child("dummy") != null) {
                return new DummyPersistence.Factory();
            }
        }

        return new ProtonEngine.Factory(c.getSearch());
    }
Creates the correct engine factory from XML.
config-model/src/main/java/com/yahoo/vespa/model/content/cluster/EngineFactoryBuilder.java