mirror of https://github.com/apache/druid.git
Merge pull request #305 from metamx/npe-deprecated-fix
Remove deprecated jackson calls and fix NPE
This commit is contained in:
commit
23133f3b5b
|
@ -49,7 +49,7 @@ public class JacksonModule implements Module
|
||||||
public ObjectMapper smileMapper()
|
public ObjectMapper smileMapper()
|
||||||
{
|
{
|
||||||
ObjectMapper retVal = new DefaultObjectMapper(new SmileFactory());
|
ObjectMapper retVal = new DefaultObjectMapper(new SmileFactory());
|
||||||
retVal.getJsonFactory().setCodec(retVal);
|
retVal.getFactory().setCodec(retVal);
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class DirectDruidClient<T> implements QueryRunner<T>
|
||||||
this.httpClient = httpClient;
|
this.httpClient = httpClient;
|
||||||
this.host = host;
|
this.host = host;
|
||||||
|
|
||||||
this.isSmile = this.objectMapper.getJsonFactory() instanceof SmileFactory;
|
this.isSmile = this.objectMapper.getFactory() instanceof SmileFactory;
|
||||||
this.openConnections = new AtomicInteger();
|
this.openConnections = new AtomicInteger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ public class DirectDruidClient<T> implements QueryRunner<T>
|
||||||
{
|
{
|
||||||
if (jp == null) {
|
if (jp == null) {
|
||||||
try {
|
try {
|
||||||
jp = objectMapper.getJsonFactory().createJsonParser(future.get());
|
jp = objectMapper.getFactory().createParser(future.get());
|
||||||
if (jp.nextToken() != JsonToken.START_ARRAY) {
|
if (jp.nextToken() != JsonToken.START_ARRAY) {
|
||||||
throw new IAE("Next token wasn't a START_ARRAY, was[%s]", jp.getCurrentToken());
|
throw new IAE("Next token wasn't a START_ARRAY, was[%s]", jp.getCurrentToken());
|
||||||
} else {
|
} else {
|
||||||
|
@ -292,7 +292,9 @@ public class DirectDruidClient<T> implements QueryRunner<T>
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException
|
public void close() throws IOException
|
||||||
{
|
{
|
||||||
|
if(jp != null) {
|
||||||
jp.close();
|
jp.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue