You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/04/20 11:28:12 UTC
[GitHub] [druid] FrankChen021 commented on a change in pull request #10980: Fix Smile encoding for HTTP response
FrankChen021 commented on a change in pull request #10980:
URL: https://github.com/apache/druid/pull/10980#discussion_r616595374
##########
File path: integration-tests/src/main/java/org/apache/druid/testing/clients/AbstractQueryResourceTestClient.java
##########
@@ -21,67 +21,157 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.jaxrs.smile.SmileMediaTypes;
import com.google.inject.Inject;
+import org.apache.druid.guice.annotations.Smile;
+import org.apache.druid.java.util.common.IAE;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.http.client.HttpClient;
import org.apache.druid.java.util.http.client.Request;
+import org.apache.druid.java.util.http.client.response.BytesFullResponseHandler;
+import org.apache.druid.java.util.http.client.response.BytesFullResponseHolder;
import org.apache.druid.java.util.http.client.response.StatusResponseHandler;
import org.apache.druid.java.util.http.client.response.StatusResponseHolder;
-import org.apache.druid.testing.IntegrationTestingConfig;
import org.apache.druid.testing.guice.TestClient;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.jboss.netty.handler.codec.http.HttpMethod;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
public abstract class AbstractQueryResourceTestClient<QueryType>
{
- private final ObjectMapper jsonMapper;
- private final HttpClient httpClient;
+ private String contentTypeHeader = MediaType.APPLICATION_JSON;
+
+ /**
+ * a 'null' means the Content-Type in response defaults to Content-Type of request
+ */
+ private String acceptHeader = null;
+
+ final ObjectMapper jsonMapper;
+ final ObjectMapper smileMapper;
+ final HttpClient httpClient;
final String routerUrl;
+ final Map<String, EncoderDecoder<QueryType>> encoderDecoderMap;
Review comment:
It's possible since the generic type 'QueryType' is defined on outer class and used by `query` function which is the caller of this `EncoderDecoder`.
This generic contract has been removed in the new commit, because I found that its implementation has nothing to do with type info.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org