Search in sources :

Example 1 with AbstractSearchCluster

use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.

the class RankSetupValidator method validate.

@Override
public void validate(VespaModel model, DeployState deployState) {
    try {
        File cfgDir = Files.createTempDirectory("deploy_ranksetup").toFile();
        for (AbstractSearchCluster cluster : model.getSearchClusters()) {
            // Skipping rank expression checking for streaming clusters, not implemented yet
            if (cluster.isRealtime()) {
                IndexedSearchCluster sc = (IndexedSearchCluster) cluster;
                String clusterDir = cfgDir.getAbsolutePath() + "/" + sc.getClusterName() + "/";
                for (DocumentDatabase docDb : sc.getDocumentDbs()) {
                    final String name = docDb.getDerivedConfiguration().getSearch().getName();
                    String searchDir = clusterDir + name + "/";
                    writeConfigs(searchDir, docDb);
                    if (!validate("dir:" + searchDir, sc, name, deployState.getDeployLogger(), cfgDir)) {
                        return;
                    }
                }
            }
        }
        deleteTempDir(cfgDir);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IndexedSearchCluster(com.yahoo.vespa.model.search.IndexedSearchCluster) AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster) IOException(java.io.IOException) File(java.io.File) DocumentDatabase(com.yahoo.vespa.model.search.DocumentDatabase)

Example 2 with AbstractSearchCluster

use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.

the class SearchDataTypeValidator method validate.

@Override
public void validate(VespaModel model, DeployState deployState) {
    List<AbstractSearchCluster> clusters = model.getSearchClusters();
    for (AbstractSearchCluster cluster : clusters) {
        if (cluster.isStreaming()) {
            continue;
        }
        for (AbstractSearchCluster.SearchDefinitionSpec spec : cluster.getLocalSDS()) {
            SDDocumentType docType = spec.getSearchDefinition().getSearch().getDocument();
            if (docType == null) {
                continue;
            }
            validateDocument(cluster, spec.getSearchDefinition(), docType);
        }
    }
}
Also used : AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster) SDDocumentType(com.yahoo.searchdefinition.document.SDDocumentType)

Example 3 with AbstractSearchCluster

use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.

the class ContainerCluster method getConfig.

@Override
public void getConfig(IlscriptsConfig.Builder builder) {
    List<AbstractSearchCluster> searchClusters = new ArrayList<>();
    searchClusters.addAll(Content.getSearchClusters(getRoot().configModelRepo()));
    for (AbstractSearchCluster searchCluster : searchClusters) {
        searchCluster.getConfig(builder);
    }
}
Also used : AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster) ArrayList(java.util.ArrayList)

Example 4 with AbstractSearchCluster

use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.

the class SearchChains method setSearchClusterForLocalProvider.

private void setSearchClusterForLocalProvider(Map<String, ? extends AbstractSearchCluster> clusterIndexByName) {
    for (LocalProvider provider : localProviders()) {
        AbstractSearchCluster cluster = clusterIndexByName.get(provider.getClusterName());
        if (cluster == null) {
            throw new RuntimeException("No searchable content cluster with id '" + provider.getClusterName() + "'");
        }
        provider.setSearchCluster(cluster);
    }
}
Also used : AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster)

Example 5 with AbstractSearchCluster

use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.

the class StreamingValidator method validate.

@Override
public void validate(VespaModel model, DeployState deployState) {
    List<AbstractSearchCluster> searchClusters = model.getSearchClusters();
    for (AbstractSearchCluster cluster : searchClusters) {
        if (!cluster.isStreaming()) {
            continue;
        }
        SearchCluster sc = (SearchCluster) cluster;
        warnStreamingAttributes(sc, deployState.getDeployLogger());
        warnStreamingGramMatching(sc, deployState.getDeployLogger());
        failStreamingDocumentReferences(sc);
    }
}
Also used : SearchCluster(com.yahoo.vespa.model.search.SearchCluster) AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster) AbstractSearchCluster(com.yahoo.vespa.model.search.AbstractSearchCluster)

Aggregations

AbstractSearchCluster (com.yahoo.vespa.model.search.AbstractSearchCluster)8 IndexedSearchCluster (com.yahoo.vespa.model.search.IndexedSearchCluster)3 DocumentDatabase (com.yahoo.vespa.model.search.DocumentDatabase)2 DocumentSelector (com.yahoo.document.select.DocumentSelector)1 Index (com.yahoo.searchdefinition.Index)1 Search (com.yahoo.searchdefinition.Search)1 DerivedConfiguration (com.yahoo.searchdefinition.derived.DerivedConfiguration)1 SDDocumentType (com.yahoo.searchdefinition.document.SDDocumentType)1 SDField (com.yahoo.searchdefinition.document.SDField)1 SearchCluster (com.yahoo.vespa.model.search.SearchCluster)1 File (java.io.File)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1