Skip to content

Commit

Permalink
Do not use deprecated API ObjectMapper.writerWithType()
Browse files Browse the repository at this point in the history
  • Loading branch information
kfaraz committed Jan 6, 2025
1 parent 09840ad commit 9d41869
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ protected void reduce(

try {
HadoopDruidIndexerConfig.JSON_MAPPER
.writerWithType(Long.class)
.writerFor(Long.class)
.writeValue(out, aggregate.estimateCardinalityRound());
}
finally {
Expand All @@ -430,7 +430,7 @@ public void run(Context context)
final OutputStream out = Utils.makePathAndOutputStream(context, outPath, config.isOverwriteFiles());

try {
HadoopDruidIndexerConfig.JSON_MAPPER.writerWithType(
HadoopDruidIndexerConfig.JSON_MAPPER.writerFor(
new TypeReference<List<Interval>>()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ protected void innerReduce(Context context, SortableBytes keyBytes, Iterable<Dim

try {
HadoopDruidIndexerConfig.JSON_MAPPER
.writerWithType(
.writerFor(
new TypeReference<List<ShardSpec>>()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void onSuccess(ChangeRequestsSnapshot result)
try {
HttpServletResponse response = (HttpServletResponse) asyncContext.getResponse();
response.setStatus(HttpServletResponse.SC_OK);
context.inputMapper.writerWithType(WorkerHolder.WORKER_SYNC_RESP_TYPE_REF)
context.inputMapper.writerFor(WorkerHolder.WORKER_SYNC_RESP_TYPE_REF)
.writeValue(asyncContext.getResponse().getOutputStream(), result);
asyncContext.complete();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public HttpLoadQueuePeon(
)
{
this.jsonMapper = jsonMapper;
this.requestBodyWriter = jsonMapper.writerWithType(REQUEST_ENTITY_TYPE_REF);
this.requestBodyWriter = jsonMapper.writerFor(REQUEST_ENTITY_TYPE_REF);
this.httpClient = httpClient;
this.config = config;
this.processingExecutor = processingExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void onSuccess(ChangeRequestsSnapshot<DataSegmentChangeRequest> result)
try {
HttpServletResponse response = (HttpServletResponse) asyncContext.getResponse();
response.setStatus(HttpServletResponse.SC_OK);
context.inputMapper.writerWithType(HttpServerInventoryView.SEGMENT_LIST_RESP_TYPE_REF)
context.inputMapper.writerFor(HttpServerInventoryView.SEGMENT_LIST_RESP_TYPE_REF)
.writeValue(asyncContext.getResponse().getOutputStream(), result);
asyncContext.complete();
}
Expand Down Expand Up @@ -295,7 +295,7 @@ public void onSuccess(List<DataSegmentChangeResponse> result)
try {
HttpServletResponse response = (HttpServletResponse) asyncContext.getResponse();
response.setStatus(HttpServletResponse.SC_OK);
context.inputMapper.writerWithType(HttpLoadQueuePeon.RESPONSE_ENTITY_TYPE_REF)
context.inputMapper.writerFor(HttpLoadQueuePeon.RESPONSE_ENTITY_TYPE_REF)
.writeValue(asyncContext.getResponse().getOutputStream(), result);
asyncContext.complete();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testSimple() throws Exception
ImmutableList.of(
Futures.immediateFuture(
new ByteArrayInputStream(
jsonMapper.writerWithType(typeRef).writeValueAsBytes(
jsonMapper.writerFor(typeRef).writeValueAsBytes(
new ChangeRequestsSnapshot(
false,
null,
Expand All @@ -72,7 +72,7 @@ public void testSimple() throws Exception
),
Futures.immediateFuture(
new ByteArrayInputStream(
jsonMapper.writerWithType(typeRef).writeValueAsBytes(
jsonMapper.writerFor(typeRef).writeValueAsBytes(
new ChangeRequestsSnapshot(
false,
null,
Expand All @@ -84,7 +84,7 @@ public void testSimple() throws Exception
),
Futures.immediateFuture(
new ByteArrayInputStream(
jsonMapper.writerWithType(typeRef).writeValueAsBytes(
jsonMapper.writerFor(typeRef).writeValueAsBytes(
new ChangeRequestsSnapshot(
true,
"reset the counter",
Expand All @@ -96,7 +96,7 @@ public void testSimple() throws Exception
),
Futures.immediateFuture(
new ByteArrayInputStream(
jsonMapper.writerWithType(typeRef).writeValueAsBytes(
jsonMapper.writerFor(typeRef).writeValueAsBytes(
new ChangeRequestsSnapshot(
false,
null,
Expand All @@ -108,7 +108,7 @@ public void testSimple() throws Exception
),
Futures.immediateFuture(
new ByteArrayInputStream(
jsonMapper.writerWithType(typeRef).writeValueAsBytes(
jsonMapper.writerFor(typeRef).writeValueAsBytes(
new ChangeRequestsSnapshot(
false,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public <Intermediate, Final> ListenableFuture<Final> go(
return (ListenableFuture<Final>) Futures.immediateFuture(
new ByteArrayInputStream(
MAPPER
.writerWithType(HttpLoadQueuePeon.RESPONSE_ENTITY_TYPE_REF)
.writerFor(HttpLoadQueuePeon.RESPONSE_ENTITY_TYPE_REF)
.writeValueAsBytes(statuses)
)
);
Expand Down

0 comments on commit 9d41869

Please sign in to comment.