All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.openlineage.client.circuitBreaker.NoOpCircuitBreaker Maven / Gradle / Ivy

There is a newer version: 1.26.0
Show newest version
/*
/* Copyright 2018-2024 contributors to the OpenLineage project
/* SPDX-License-Identifier: Apache-2.0
*/

package io.openlineage.client.circuitBreaker;

import java.util.concurrent.Callable;
import lombok.extern.slf4j.Slf4j;

/** Non-closing circuit breaker which always runs callable. */
@Slf4j
public class NoOpCircuitBreaker extends ExecutorCircuitBreaker {

  public NoOpCircuitBreaker() {
    super(0);
  }

  @Override
  public CircuitBreakerState currentState() {
    return new CircuitBreakerState(false);
  }

  @Override
  public  T run(Callable callable) {
    try {
      return callable.call();
    } catch (Exception e) {
      log.error("OpenLineage callable failed to execute. Swallowing the exception {}", e);
      return null;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy