Search in sources :

Example 1 with FailureDetector

use of com.facebook.presto.failureDetector.FailureDetector in project presto by prestodb.

the class ServerMainModule method bindFailureDetector.

private static void bindFailureDetector(Binder binder, boolean coordinator) {
    // TODO: this is a hack until the coordinator module works correctly
    if (coordinator) {
        binder.install(new FailureDetectorModule());
        jaxrsBinder(binder).bind(NodeResource.class);
    } else {
        binder.bind(FailureDetector.class).toInstance(new FailureDetector() {

            @Override
            public Set<ServiceDescriptor> getFailed() {
                return ImmutableSet.of();
            }
        });
    }
}
Also used : Set(java.util.Set) ImmutableSet(com.google.common.collect.ImmutableSet) FailureDetector(com.facebook.presto.failureDetector.FailureDetector) FailureDetectorModule(com.facebook.presto.failureDetector.FailureDetectorModule)

Aggregations

FailureDetector (com.facebook.presto.failureDetector.FailureDetector)1 FailureDetectorModule (com.facebook.presto.failureDetector.FailureDetectorModule)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Set (java.util.Set)1