Search in sources :

Example 1 with Mirror

use of com.yahoo.jrt.slobrok.api.Mirror in project vespa by vespa-engine.

the class SlobrokTest method setUp.

public void setUp() throws ListenFailedException {
    slobrok = new Slobrok();
    slobroks = new String[1];
    slobroks[0] = new Spec("localhost", slobrok.port()).toString();
    SlobrokList slobroklist = new SlobrokList();
    slobroklist.setup(slobroks);
    acceptor = server.listen(new Spec(0));
    mirror = new Mirror(client, slobroklist);
    register = new Register(server, slobroklist, "localhost", acceptor.port());
    mySpec = new Spec("localhost", acceptor.port()).toString();
}
Also used : Register(com.yahoo.jrt.slobrok.api.Register) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) SlobrokList(com.yahoo.jrt.slobrok.api.SlobrokList) Mirror(com.yahoo.jrt.slobrok.api.Mirror)

Example 2 with Mirror

use of com.yahoo.jrt.slobrok.api.Mirror in project vespa by vespa-engine.

the class ExternalSlobrokPolicy method init.

@Override
public void init() {
    if (slobroks != null) {
        orb = new Supervisor(new Transport());
        mirror = new Mirror(orb, slobroks);
    }
    if (configSources != null) {
        if (mirror == null) {
            orb = new Supervisor(new Transport());
            subscriber = subscribe(slobrokConfigId, new ConfigSourceSet(configSources));
        }
    }
}
Also used : Supervisor(com.yahoo.jrt.Supervisor) ConfigSourceSet(com.yahoo.config.subscription.ConfigSourceSet) Transport(com.yahoo.jrt.Transport) IMirror(com.yahoo.jrt.slobrok.api.IMirror) Mirror(com.yahoo.jrt.slobrok.api.Mirror)

Example 3 with Mirror

use of com.yahoo.jrt.slobrok.api.Mirror in project vespa by vespa-engine.

the class ExternalSlobrokPolicy method configure.

@Override
public synchronized void configure(SlobroksConfig config) {
    String[] slist = new String[config.slobrok().size()];
    for (int i = 0; i < config.slobrok().size(); i++) {
        slist[i] = config.slobrok(i).connectionspec();
    }
    if (slobroks == null) {
        slobroks = new SlobrokList();
    }
    slobroks.setup(slist);
    if (mirror == null) {
        mirror = new Mirror(orb, slobroks);
    }
}
Also used : SlobrokList(com.yahoo.jrt.slobrok.api.SlobrokList) IMirror(com.yahoo.jrt.slobrok.api.IMirror) Mirror(com.yahoo.jrt.slobrok.api.Mirror)

Example 4 with Mirror

use of com.yahoo.jrt.slobrok.api.Mirror in project vespa by vespa-engine.

the class SlobrokClient method setSlobrokConnectionSpecs.

public void setSlobrokConnectionSpecs(String[] slobrokConnectionSpecs) {
    if (equalsExistingSpec(slobrokConnectionSpecs))
        return;
    this.connectionSpecs = slobrokConnectionSpecs;
    shutdown();
    supervisor = new Supervisor(new Transport());
    SlobrokList slist = new SlobrokList();
    slist.setup(slobrokConnectionSpecs);
    mirror = new Mirror(supervisor, slist);
    freshMirror = true;
}
Also used : Supervisor(com.yahoo.jrt.Supervisor) SlobrokList(com.yahoo.jrt.slobrok.api.SlobrokList) Transport(com.yahoo.jrt.Transport) Mirror(com.yahoo.jrt.slobrok.api.Mirror)

Aggregations

Mirror (com.yahoo.jrt.slobrok.api.Mirror)4 SlobrokList (com.yahoo.jrt.slobrok.api.SlobrokList)3 Supervisor (com.yahoo.jrt.Supervisor)2 Transport (com.yahoo.jrt.Transport)2 IMirror (com.yahoo.jrt.slobrok.api.IMirror)2 ConfigSourceSet (com.yahoo.config.subscription.ConfigSourceSet)1 Register (com.yahoo.jrt.slobrok.api.Register)1 Slobrok (com.yahoo.jrt.slobrok.server.Slobrok)1