Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-3380][linkis-engineplugin-elasticsearch]errorcode code optimization #3531

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'dev-1.3.1' into dev-1.3.1-elasticsearch--errorcode
# Conflicts:
#	linkis-engineconn-plugins/elasticsearch/src/main/scala/org/apache/linkis/engineplugin/elasticsearch/executor/client/impl/ElasticSearchExecutorImpl.scala
#	linkis-engineconn-plugins/elasticsearch/src/main/scala/org/apache/linkis/engineplugin/elasticsearch/executor/client/impl/ResponseHandlerImpl.scala
binbinCheng committed Oct 17, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a75272accbdf6c1cd25162795552ddf38b9bc954
Original file line number Diff line number Diff line change
@@ -19,15 +19,24 @@ package org.apache.linkis.engineplugin.elasticsearch.executor.client.impl

import org.apache.linkis.common.utils.Utils
import org.apache.linkis.engineplugin.elasticsearch.conf.ElasticSearchConfiguration
import org.apache.linkis.engineplugin.elasticsearch.executer.client.{
import org.apache.linkis.engineplugin.elasticsearch.exception.EsConvertResponseException
import org.apache.linkis.engineplugin.elasticsearch.executor.client.{
ElasticSearchErrorResponse,
ElasticSearchExecutor,
ElasticSearchResponse,
EsClient,
EsClientFactory,
ResponseHandler
}
import org.apache.linkis.engineplugin.elasticsearch.executor.client.ResponseHandler
import org.apache.linkis.protocol.constants.TaskConstant
import org.apache.linkis.scheduler.executer.{
AliasOutputExecuteResponse,
ErrorExecuteResponse,
ExecuteResponse,
SuccessExecuteResponse
}
import org.apache.linkis.server.JMap
import org.apache.linkis.storage.utils.StorageUtils

import java.util
Original file line number Diff line number Diff line change
@@ -18,15 +18,15 @@
package org.apache.linkis.engineplugin.elasticsearch.executor.client.impl

import org.apache.linkis.common.utils.Utils
import org.apache.linkis.engineplugin.elasticsearch.errorcode.EasticsearchErrorCodeSummary.RESPONSE_FAIL_IS_EMPTY
import org.apache.linkis.engineplugin.elasticsearch.exception.EsConvertResponseException
import org.apache.linkis.engineplugin.elasticsearch.executor.client.{
ElasticSearchJsonResponse,
ElasticSearchResponse,
ElasticSearchTableResponse,
ResponseHandler
}
import org.apache.linkis.engineplugin.elasticsearch.executer.client.ResponseHandler._
import org.apache.linkis.engineplugin.elasticsearch.executor.client.ResponseHandler
import org.apache.linkis.engineplugin.elasticsearch.executor.client.ResponseHandler._
import org.apache.linkis.storage.domain._
import org.apache.linkis.storage.resultset.table.TableRecord

@@ -53,7 +53,9 @@ class ResponseHandlerImpl extends ResponseHandler {
val contentBytes = EntityUtils.toByteArray(response.getEntity)

if (contentBytes == null || contentBytes.isEmpty) {
throw EsConvertResponseException(RESPONSE_FAIL_IS_EMPTY.getErrorDesc)
throw EsConvertResponseException(
"EsEngineExecutor convert response fail, response content is empty."
)
}

val jsonNode = Utils.tryCatch {
You are viewing a condensed version of this merge commit. You can view the full changes here.