use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper in project pinot by linkedin.
the class ContributorTest method main.
public static void main(String[] args) throws Exception {
ContributorViewRequest request = new ContributorViewRequest();
String collection = "thirdeyeAbook";
DateTime baselineStart = new DateTime(2016, 3, 23, 00, 00);
List<MetricExpression> metricExpressions = new ArrayList<>();
metricExpressions.add(new MetricExpression("__COUNT", "__COUNT"));
request.setCollection(collection);
request.setBaselineStart(baselineStart);
request.setBaselineEnd(baselineStart.plusDays(1));
request.setCurrentStart(baselineStart.plusDays(7));
request.setCurrentEnd(baselineStart.plusDays(8));
request.setTimeGranularity(new TimeGranularity(1, TimeUnit.HOURS));
request.setMetricExpressions(metricExpressions);
// TODO
PinotThirdEyeClient pinotThirdEyeClient = PinotThirdEyeClient.getDefaultTestClient();
// make
// this
// configurable;
QueryCache queryCache = new QueryCache(pinotThirdEyeClient, Executors.newFixedThreadPool(10));
ContributorViewHandler handler = new ContributorViewHandler(queryCache);
ContributorViewResponse response = handler.process(request);
ObjectMapper mapper = new ObjectMapper();
String jsonResponse = mapper.writeValueAsString(response);
System.out.println(jsonResponse);
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper in project pinot by linkedin.
the class HeatMapTest method main.
public static void main(String[] args) throws Exception {
HeatMapViewRequest request = new HeatMapViewRequest();
String collection = "thirdeyeAbook";
DateTime baselineStart = new DateTime(2016, 3, 23, 00, 00);
List<MetricExpression> metricExpressions = new ArrayList<>();
metricExpressions.add(new MetricExpression("__COUNT", "__COUNT"));
request.setCollection(collection);
request.setBaselineStart(baselineStart);
request.setBaselineEnd(baselineStart.plusHours(1));
request.setCurrentStart(baselineStart.plusDays(7));
request.setCurrentEnd(baselineStart.plusDays(7).plusHours(1));
request.setTimeGranularity(new TimeGranularity(1, TimeUnit.HOURS));
request.setMetricExpressions(metricExpressions);
// TODO
PinotThirdEyeClient pinotThirdEyeClient = PinotThirdEyeClient.getDefaultTestClient();
// make
// this
// configurable;
QueryCache queryCache = new QueryCache(pinotThirdEyeClient, Executors.newFixedThreadPool(10));
HeatMapViewHandler handler = new HeatMapViewHandler(queryCache);
HeatMapViewResponse response = handler.process(request);
ObjectMapper mapper = new ObjectMapper();
String jsonResponse = mapper.writeValueAsString(response);
System.out.println(jsonResponse);
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper in project pinot by linkedin.
the class TestAnomalyTaskManager method getTestTaskSpec.
TaskDTO getTestTaskSpec(JobDTO anomalyJobSpec) throws JsonProcessingException {
TaskDTO jobSpec = new TaskDTO();
jobSpec.setJobName("Test_Anomaly_Task");
jobSpec.setStatus(TaskStatus.WAITING);
jobSpec.setTaskType(TaskType.ANOMALY_DETECTION);
jobSpec.setStartTime(new DateTime().minusDays(20).getMillis());
jobSpec.setEndTime(new DateTime().minusDays(10).getMillis());
jobSpec.setTaskInfo(new ObjectMapper().writeValueAsString(getTestDetectionTaskInfo()));
jobSpec.setJobId(anomalyJobSpec.getId());
return jobSpec;
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper in project jersey by jersey.
the class MyObjectMapperProvider method createDefaultMapper.
private static ObjectMapper createDefaultMapper() {
final ObjectMapper result = new ObjectMapper();
result.enable(SerializationFeature.INDENT_OUTPUT);
return result;
}
use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper in project jersey by jersey.
the class MyObjectMapperProvider method getContext.
@Override
public ObjectMapper getContext(Class<?> type) {
if (type == Issue2322Resource.JsonString1.class) {
ObjectMapper result = new ObjectMapper();
result.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
result.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
return result;
} else {
return new ObjectMapper();
}
}
Aggregations