blob: 7e19df254c12a890ef63f54d01354815d167c784 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.core.slobrok;
import com.yahoo.cloud.config.SlobroksConfig;
import com.yahoo.cloud.config.SlobroksConfig.Slobrok;
import com.yahoo.container.Container;
import java.util.List;
import java.util.stream.Collectors;
/**
* Configures which slobrok nodes the container should register with.
* @author tonytv
*/
public class SlobrokConfigurator {
public SlobrokConfigurator(SlobroksConfig config) {
Container.get().getRpcAdaptor().registerInSlobrok(
connectionSpecs(config.slobrok()));
}
private static List<String> connectionSpecs(List<Slobrok> slobroks) {
return slobroks.stream().
map(Slobrok::connectionspec).
collect(Collectors.toList());
}
}
|