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);
}
}
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);
}
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations