org.elasticsearch.action.ActionListener.onFailure()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(184)

本文整理了Java中org.elasticsearch.action.ActionListener.onFailure()方法的一些代码示例,展示了ActionListener.onFailure()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActionListener.onFailure()方法的具体详情如下:
包路径:org.elasticsearch.action.ActionListener
类名称:ActionListener
方法名:onFailure

ActionListener.onFailure介绍

[英]Notifies every given listener with the failure passed to #onFailure(Exception). If a listener itself throws an exception all remaining listeners will be processed and the caught exception will be re-thrown.
[中]向每个给定的侦听器通知传递给#onFailure(异常)的失败。如果侦听器本身抛出异常,则将处理所有剩余的侦听器,并重新抛出捕获的异常。

代码示例

代码示例来源:origin: floragunncom/search-guard

listener.onFailure(new ElasticsearchSecurityException("Index is immutable", RestStatus.FORBIDDEN));
return true;

代码示例来源:origin: floragunncom/search-guard

listener.onFailure(new ElasticsearchSecurityException("No user found for "+action, RestStatus.INTERNAL_SERVER_ERROR));
  return;
  listener.onFailure(new ElasticsearchSecurityException("Search Guard not initialized (SG11) for "
  + action+". See http://docs.search-guard.com/v6/sgadmin", RestStatus.SERVICE_UNAVAILABLE));
  return;
  auditLog.logMissingPrivileges(action, request, task);
  log.debug("no permissions for {}", pres.getMissingPrivileges());
  listener.onFailure(new ElasticsearchSecurityException("no permissions for " + pres.getMissingPrivileges()+" and "+user, RestStatus.FORBIDDEN));
  return;
listener.onFailure(new ElasticsearchSecurityException("Unexpected exception " + action, RestStatus.INTERNAL_SERVER_ERROR));
return;

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception e) {
    listener.onFailure(e);
  }
};

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception e) {
    listener.onFailure(e);
  }
});

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception e) {
    listener.onFailure(e);
  }
});

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception e) {
    listener.onFailure(e);
  }
});

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public void onNewClusterState(ClusterState state) {
  try {
    buildResponse(request, state, listener);
  } catch (Exception e) {
    listener.onFailure(e);
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception e) {
    listener.onFailure(e);
  }
});

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public void onFailure(Exception e) {
  if (closed.compareAndSet(false, true)) {
    listener.onFailure(e);
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception t) {
    logger.debug("failed to perform aliases", t);
    listener.onFailure(t);
  }
});

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void handleException(TransportException exp) {
    logger.warn("Cannot send ban for tasks with the parent [{}] to the node [{}]", request.parentTaskId, node.key);
    listener.onFailure(exp);
  }
});

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public void handleException(TransportException e) {
  if (isDone.compareAndSet(false, true)) {
    listener.onFailure(new IllegalStateException("handshake failed", e));
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception t) {
    logger.debug(() -> new ParameterizedMessage("failed to close indices [{}]", (Object) concreteIndices), t);
    listener.onFailure(t);
  }
});

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception t) {
    logger.debug(() -> new ParameterizedMessage("failed to delete indices [{}]", concreteIndices), t);
    listener.onFailure(t);
  }
});

代码示例来源:origin: org.elasticsearch/elasticsearch

public void respond(ActionListener<TransportResponse.Empty> listener) {
    if (finalFailure == null) {
      listener.onResponse(TransportResponse.Empty.INSTANCE);
    } else {
      listener.onFailure(finalFailure);
    }
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public void onFailure(Exception e) {
  try {
    listener.onFailure(e);
  } finally {
    FutureUtils.cancel(scheduledRequestFuture);
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public void onResponse(UpgradeResponse upgradeResponse) {
  try {
    if (upgradeResponse.versions().isEmpty()) {
      listener.onResponse(upgradeResponse);
    } else {
      updateSettings(upgradeResponse, listener);
    }
  } catch (Exception e) {
    listener.onFailure(e);
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public void onFailure(Exception e) {
    resyncTask.setPhase("finished");
    taskManager.unregister(resyncTask);
    listener.onFailure(e);
  }
};

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public void handleResponse(HandshakeResponse response) {
  if (isDone.compareAndSet(false, true)) {
    Version version = response.responseVersion;
    if (currentVersion.isCompatible(version) == false) {
      listener.onFailure(new IllegalStateException("Received message from unsupported version: [" + version
        + "] minimal compatible version is: [" + currentVersion.minimumCompatibilityVersion() + "]"));
    } else {
      listener.onResponse(version);
    }
  }
}

代码示例来源:origin: org.elasticsearch/elasticsearch

public void onTimeout() {
    if (countDown.fastForward()) {
      CloseableChannel.closeChannels(channels, false);
      listener.onFailure(new ConnectTransportException(node, "connect_timeout[" + connectionProfile.getConnectTimeout()  + "]"));
    }
  }
}

相关文章