Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public List<WindowedDataSegment> getSegments()
@Override
public void write(DataOutput out) throws IOException
{
out.writeUTF(HadoopDruidIndexerConfig.JSON_MAPPER.writeValueAsString(segments));
final byte[] segmentsBytes = HadoopDruidIndexerConfig.JSON_MAPPER.writeValueAsBytes(segments);
out.writeInt(segmentsBytes.length);
out.write(segmentsBytes);
out.writeInt(locations.length);
for (String location : locations) {
out.writeUTF(location);
Expand All @@ -84,8 +86,11 @@ public void write(DataOutput out) throws IOException
@Override
public void readFields(DataInput in) throws IOException
{
final int segmentsBytesLength = in.readInt();
final byte[] buf = new byte[segmentsBytesLength];
in.readFully(buf);
segments = HadoopDruidIndexerConfig.JSON_MAPPER.readValue(
in.readUTF(),
buf,
new TypeReference<List<WindowedDataSegment>>()
{
}
Expand Down