use of com.yahoo.config.FileReference in project vespa by vespa-engine.
the class ContainerCluster method addAndSendApplicationBundles.
private void addAndSendApplicationBundles() {
for (ComponentInfo component : getRoot().getDeployState().getApplicationPackage().getComponentsInfo(getRoot().getDeployState().getProperties().vespaVersion())) {
FileReference reference = FileSender.sendFileToServices(component.getPathRelativeToAppDir(), containers);
applicationBundles.add(reference);
}
}
use of com.yahoo.config.FileReference in project vespa by vespa-engine.
the class FileSender method sendUserConfiguredFiles.
/**
* Sends all user configured files for a producer to all given services.
*/
public static <PRODUCER extends AbstractConfigProducer<?>> void sendUserConfiguredFiles(PRODUCER producer, Collection<? extends AbstractService> services, DeployLogger logger) {
if (services.isEmpty())
return;
UserConfigRepo userConfigs = producer.getUserConfigs();
Map<String, FileReference> sentFiles = new HashMap<>();
for (ConfigDefinitionKey key : userConfigs.configsProduced()) {
ConfigPayloadBuilder builder = userConfigs.get(key);
try {
sendUserConfiguredFiles(builder, sentFiles, services, key, logger);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Unable to send files for " + key, e);
}
}
}
use of com.yahoo.config.FileReference in project vespa by vespa-engine.
the class FileSender method sendFileEntry.
private static void sendFileEntry(ConfigPayloadBuilder builder, Map<String, FileReference> sentFiles, Collection<? extends AbstractService> services) {
String path = builder.getValue();
FileReference reference = sentFiles.get(path);
if (reference == null) {
reference = sendFileToServices(path, services);
sentFiles.put(path, reference);
}
builder.setValue(reference.value());
}
use of com.yahoo.config.FileReference in project vespa by vespa-engine.
the class AbstractSearchCluster method prepareToDistributeFiles.
public void prepareToDistributeFiles(List<SearchNode> backends) {
for (SearchDefinitionSpec sds : localSDS) {
for (RankingConstant constant : sds.getSearchDefinition().getSearch().getRankingConstants().values()) {
FileReference reference = (constant.getPathType() == RankingConstant.PathType.FILE) ? FileSender.sendFileToServices(constant.getFileName(), backends) : FileSender.sendUriToServices(constant.getUri(), backends);
constant.setFileReference(reference.value());
}
}
}
use of com.yahoo.config.FileReference in project vespa by vespa-engine.
the class FileDistributor method sendFileToHosts.
/**
* Adds the given file to the associated application packages' registry of file and marks the file
* for distribution to the given hosts.
* <b>Note: This class receives ownership of the given collection.</b>
*
* @return the reference to the file, created by the application package
*/
public FileReference sendFileToHosts(String relativePath, Collection<Host> hosts) {
FileReference reference = fileRegistry.addFile(relativePath);
addToFilesToDistribute(reference, hosts);
return reference;
}
Aggregations