public class FragmentsResponse
extends java.lang.Object
implements javax.ws.rs.core.StreamingOutput
StreamingOutput
so the serialization will be done in a stream and not
in one bulk, this in order to avoid running out of memory when processing a
lot of fragments.Constructor and Description |
---|
FragmentsResponse(java.util.List<Fragment> fragments)
Constructs fragments response out of a list of fragments
|
Modifier and Type | Method and Description |
---|---|
void |
write(java.io.OutputStream output)
Serializes a fragments list in JSON, To be used as the result string for
HAWQ.
|
public FragmentsResponse(java.util.List<Fragment> fragments)
fragments
- fragment listpublic void write(java.io.OutputStream output) throws java.io.IOException, javax.ws.rs.WebApplicationException
{"PXFFragments":[{"replicas":
["sdw1.corp.emc.com","sdw3.corp.emc.com","sdw8.corp.emc.com"],
"sourceName":"text2.csv", "index":"0","metadata":"<base64 metadata for fragment>",
"userData":"<data_specific_to_third_party_fragmenter>"
},{"replicas":["sdw2.corp.emc.com","sdw4.corp.emc.com","sdw5.corp.emc.com"
],"sourceName":"text_data.csv","index":"0","metadata":
"<base64 metadata for fragment>"
,"userData":"<data_specific_to_third_party_fragmenter>"
}]}
write
in interface javax.ws.rs.core.StreamingOutput
java.io.IOException
javax.ws.rs.WebApplicationException