Skip to content

Commit

Permalink
Fix formatting for TypeReference usages
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshat-Jain committed Dec 13, 2024
1 parent b1cefce commit 1b8d536
Show file tree
Hide file tree
Showing 41 changed files with 62 additions and 178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ protected TreeMap<Integer, Map<String, Long>> getCheckPointsFromContext(
log.debug("Got checkpoints from task context[%s].", checkpointsString);
return toolbox.getJsonMapper().readValue(
checkpointsString,
new TypeReference<>()
{
});
new TypeReference<>() {}
);
} else {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@
*/
public class RabbitStreamSupervisor extends SeekableStreamSupervisor<String, Long, ByteEntity>
{
public static final TypeReference<TreeMap<Integer, Map<String, Long>>> CHECKPOINTS_TYPE_REF = new TypeReference<>()
{
};
public static final TypeReference<TreeMap<Integer, Map<String, Long>>> CHECKPOINTS_TYPE_REF = new TypeReference<>() {};

private static final EmittingLogger log = new EmittingLogger(RabbitStreamSupervisor.class);
private static final Long NOT_SET = -1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,9 @@ public class CatalogClient implements CatalogSource
{
public static final String SCHEMA_SYNC_PATH = CatalogResource.ROOT_PATH + CatalogResource.SCHEMA_SYNC;
public static final String TABLE_SYNC_PATH = CatalogResource.ROOT_PATH + CatalogResource.TABLE_SYNC;
private static final TypeReference<List<TableMetadata>> LIST_OF_TABLE_METADATA_TYPE = new TypeReference<>()
{
};
private static final TypeReference<List<TableMetadata>> LIST_OF_TABLE_METADATA_TYPE = new TypeReference<>() {};
// Not strictly needed as a TypeReference, but doing so makes the code simpler.
private static final TypeReference<TableMetadata> TABLE_METADATA_TYPE = new TypeReference<>()
{
};
private static final TypeReference<TableMetadata> TABLE_METADATA_TYPE = new TypeReference<>() {};

private final DruidLeaderClient coordClient;
private final ObjectMapper smileMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,7 @@ protected TreeMap<Integer, Map<KafkaTopicPartition, Long>> getCheckPointsFromCon
log.debug("Got checkpoints from task context[%s].", checkpointsString);
return toolbox.getJsonMapper().readValue(
checkpointsString,
new TypeReference<>()
{
}
new TypeReference<>() {}
);
} else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ protected TreeMap<Integer, Map<String, String>> getCheckPointsFromContext(
log.debug("Got checkpoints from task context[%s]", checkpointsString);
return toolbox.getJsonMapper().readValue(
checkpointsString,
new TypeReference<>()
{
}
new TypeReference<>() {}
);
} else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ public void test_taskReportDestination() throws IOException
final TaskReport.ReportMap reportMap =
JSON_MAPPER.readValue(
baos.toByteArray(),
new TypeReference<>()
{
}
new TypeReference<>() {}
);

Assert.assertEquals(ImmutableSet.of("multiStageQuery", TaskContextReport.REPORT_KEY), reportMap.keySet());
Expand Down Expand Up @@ -185,9 +183,7 @@ public void test_durableDestination() throws IOException
final TaskReport.ReportMap reportMap =
JSON_MAPPER.readValue(
baos.toByteArray(),
new TypeReference<>()
{
}
new TypeReference<>() {}
);

Assert.assertEquals(ImmutableSet.of("multiStageQuery", TaskContextReport.REPORT_KEY), reportMap.keySet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ public boolean run()
}
List<Interval> intervals = HadoopDruidIndexerConfig.JSON_MAPPER.readValue(
Utils.openInputStream(groupByJob, intervalInfoPath),
new TypeReference<>()
{
}
new TypeReference<>() {}
);
config.setGranularitySpec(
new UniformGranularitySpec(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,7 @@ public boolean run()
}
if (Utils.exists(dimSelectionJob, fileSystem, partitionInfoPath)) {
List<ShardSpec> specs = HadoopDruidIndexerConfig.JSON_MAPPER.readValue(
Utils.openInputStream(dimSelectionJob, partitionInfoPath), new TypeReference<>()
{
}
Utils.openInputStream(dimSelectionJob, partitionInfoPath), new TypeReference<>() {}
);

List<HadoopyShardSpec> actualSpecs = Lists.newArrayListWithExpectedSize(specs.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,7 @@ public TaskStatus call()
try {
List<String> taskJavaOptsArray = jsonMapper.convertValue(
task.getContextValue(ForkingTaskRunnerConfig.JAVA_OPTS_ARRAY_PROPERTY),
new TypeReference<>()
{
}
new TypeReference<>() {}
);
if (taskJavaOptsArray != null) {
command.addAll(taskJavaOptsArray);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ public class WorkerHolder
{
private static final EmittingLogger log = new EmittingLogger(WorkerHolder.class);

public static final TypeReference<ChangeRequestsSnapshot<WorkerHistoryItem>> WORKER_SYNC_RESP_TYPE_REF = new TypeReference<>()
{
};
public static final TypeReference<ChangeRequestsSnapshot<WorkerHistoryItem>> WORKER_SYNC_RESP_TYPE_REF = new TypeReference<>() {};


private final Worker worker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ public byte[] encode(Object content) throws IOException
@Override
public List<Map<String, Object>> decode(byte[] content) throws IOException
{
return om.readValue(content, new TypeReference<>()
{
});
return om.readValue(content, new TypeReference<>() {});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ public List<String> getDimensions(String dataSource, String interval)
);
}
return jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ public List<String> getSegments(final String dataSource)
);

segments = jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
}
catch (Exception e) {
Expand All @@ -152,9 +150,7 @@ public List<DataSegment> getFullSegmentsMetadata(final String dataSource)
);

segments = jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
}
catch (Exception e) {
Expand All @@ -171,9 +167,7 @@ public List<String> getSegmentIntervals(final String dataSource)
StatusResponseHolder response = makeRequest(HttpMethod.GET, getIntervalsURL(dataSource));

segments = jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
}
catch (Exception e) {
Expand All @@ -189,9 +183,7 @@ public List<DataSegment> getAvailableSegments(final String dataSource)
StatusResponseHolder response = makeRequest(HttpMethod.GET, getFullSegmentsURL(dataSource));

return jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
}
catch (Exception e) {
Expand Down Expand Up @@ -222,9 +214,7 @@ private Map<String, Integer> getLoadStatus(String dataSource)
}

status = jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
}
catch (Exception e) {
Expand Down Expand Up @@ -365,9 +355,7 @@ private Map<String, Map<HostAndPort, LookupsState<LookupExtractorFactoryMapConta

status = jsonMapper.readValue(
response.getContent(),
new TypeReference<>()
{
}
new TypeReference<>() {}
);
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ public TaskStatusPlus getTaskStatus(String taskID)
LOG.debug("Index status response" + response.getContent());
TaskStatusResponse taskStatusResponse = jsonMapper.readValue(
response.getContent(),
new TypeReference<>()
{
}
new TypeReference<>() {}
);
return taskStatusResponse.getStatus();
}
Expand Down Expand Up @@ -236,9 +234,7 @@ private List<TaskResponseObject> getTasks(String identifier)
LOG.debug("Tasks %s response %s", identifier, response.getContent());
}
return jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
}
catch (Exception e) {
Expand All @@ -257,9 +253,7 @@ public TaskPayloadResponse getTaskPayload(String taskId)
LOG.debug("Task %s response %s", taskId, response.getContent());
}
return jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
}
catch (ISE e) {
Expand Down Expand Up @@ -350,9 +344,7 @@ public Map<String, List<Interval>> getLockedIntervals(List<LockFilterPolicy> loc
).get();
return jsonMapper.readValue(
response.getContent(),
new TypeReference<>()
{
}
new TypeReference<>() {}
);
}
catch (Exception e) {
Expand Down Expand Up @@ -758,9 +750,7 @@ public List<Object> getSupervisorHistory(String id)
);
}
List<Object> responseData = jsonMapper.readValue(
response.getContent(), new TypeReference<>()
{
}
response.getContent(), new TypeReference<>() {}
);
return responseData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ public void testQueriesFromFile(String url, String filePath) throws Exception
List<QueryResultType> queries =
jsonMapper.readValue(
TestQueryHelper.class.getResourceAsStream(filePath),
new TypeReference<>()
{
}
new TypeReference<>() {}
);

testQueries(url, queries);
Expand All @@ -131,9 +129,7 @@ public void testQueriesFromString(String url, String str) throws Exception
List<QueryResultType> queries =
jsonMapper.readValue(
str,
new TypeReference<>()
{
}
new TypeReference<>() {}
);
testQueries(url, queries);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,7 @@ public void testQueriesFromFile(String filePath, String fullDatasourcePath) thro
List<MsqQueryWithResults> queries =
jsonMapper.readValue(
TestQueryHelper.class.getResourceAsStream(filePath),
new TypeReference<>()
{
}
new TypeReference<>() {}
);
for (MsqQueryWithResults queryWithResults : queries) {
String queryString = queryWithResults.getQuery();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ private void testQueries(List<QueryWithResults> queries, Expectation expectation

List<Map<String, Object>> result = jsonMapper.readValue(
responseHolder.getContent(),
new TypeReference<>()
{
}
new TypeReference<>() {}
);
if (!QueryResultVerifier.compareResults(
result,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ public class GroupByQueryQueryToolChest extends QueryToolChest<ResultRow, GroupB
private static final byte GROUPBY_QUERY = 0x14;
private static final TypeReference<Object> OBJECT_TYPE_REFERENCE =
new TypeReference<>() {};
private static final TypeReference<ResultRow> TYPE_REFERENCE = new TypeReference<>()
{
};
private static final TypeReference<ResultRow> TYPE_REFERENCE = new TypeReference<>() {};

private final GroupingEngine groupingEngine;
private final GroupByQueryConfig queryConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ public synchronized List<LookupBean> pullExistingSnapshot(final String tier)
LOGGER.warn("found empty file no lookups to load from [%s]", persistFile.getAbsolutePath());
return Collections.emptyList();
}
lookupBeanList = objectMapper.readValue(persistFile, new TypeReference<>()
{
});
lookupBeanList = objectMapper.readValue(persistFile, new TypeReference<>() {});
return lookupBeanList;
}
catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@

public class SegmentMetadataQueryQueryToolChest extends QueryToolChest<SegmentAnalysis, SegmentMetadataQuery>
{
private static final TypeReference<SegmentAnalysis> TYPE_REFERENCE = new TypeReference<>()
{
};
private static final TypeReference<SegmentAnalysis> TYPE_REFERENCE = new TypeReference<>() {};
private static final byte SEGMENT_METADATA_CACHE_PREFIX = 0x4;
private static final byte SEGMENT_METADATA_QUERY = 0x16;
private static final Function<SegmentAnalysis, SegmentAnalysis> MERGE_TRANSFORM_FN =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@

public class ScanQueryQueryToolChest extends QueryToolChest<ScanResultValue, ScanQuery>
{
private static final TypeReference<ScanResultValue> TYPE_REFERENCE = new TypeReference<>()
{
};
private static final TypeReference<ScanResultValue> TYPE_REFERENCE = new TypeReference<>() {};

private final GenericQueryMetricsFactory queryMetricsFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@
public class SearchQueryQueryToolChest extends QueryToolChest<Result<SearchResultValue>, SearchQuery>
{
private static final byte SEARCH_QUERY = 0x15;
private static final TypeReference<Result<SearchResultValue>> TYPE_REFERENCE = new TypeReference<>()
{
};
private static final TypeReference<Object> OBJECT_TYPE_REFERENCE = new TypeReference<>()
{
};
private static final TypeReference<Result<SearchResultValue>> TYPE_REFERENCE = new TypeReference<>() {};
private static final TypeReference<Object> OBJECT_TYPE_REFERENCE = new TypeReference<>() {};

private final SearchQueryConfig config;
private final SearchQueryMetricsFactory queryMetricsFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@ public class TimeBoundaryQueryQueryToolChest
{
private static final byte TIMEBOUNDARY_QUERY = 0x3;

private static final TypeReference<Result<TimeBoundaryResultValue>> TYPE_REFERENCE = new TypeReference<>()
{
};
private static final TypeReference<Object> OBJECT_TYPE_REFERENCE = new TypeReference<>()
{
};
private static final TypeReference<Result<TimeBoundaryResultValue>> TYPE_REFERENCE = new TypeReference<>() {};
private static final TypeReference<Object> OBJECT_TYPE_REFERENCE = new TypeReference<>() {};

private final GenericQueryMetricsFactory queryMetricsFactory;

Expand Down
Loading

0 comments on commit 1b8d536

Please sign in to comment.