Search in sources :

Example 1 with IMirror

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

the class ExternalSlobrokPolicy method lookup.

public Mirror.Entry[] lookup(RoutingContext context, String pattern) {
    IMirror mirror1 = (mirror != null ? mirror : context.getMirror());
    Mirror.Entry[] arr = mirror1.lookup(pattern);
    if ((arr.length == 0) && firstTry) {
        synchronized (this) {
            try {
                int count = 0;
                while (arr.length == 0 && count < 100) {
                    Thread.sleep(50);
                    arr = mirror1.lookup(pattern);
                    count++;
                }
            } catch (InterruptedException e) {
            }
        }
    }
    firstTry = false;
    return arr;
}
Also used : IMirror(com.yahoo.jrt.slobrok.api.IMirror)

Aggregations

IMirror (com.yahoo.jrt.slobrok.api.IMirror)1