MCPcopy Create free account
hub / github.com/apache/pig / serialize

Method serialize

src/org/apache/pig/impl/util/ObjectSerializer.java:37–51  ·  view source on GitHub ↗
(Serializable obj)

Source from the content-addressed store, hash-verified

35public class ObjectSerializer {
36
37 public static String serialize(Serializable obj) throws IOException {
38 if (obj == null)
39 return "";
40 try {
41 ByteArrayOutputStream serialObj = new ByteArrayOutputStream();
42 Deflater def = new Deflater(Deflater.BEST_COMPRESSION);
43 ObjectOutputStream objStream = new ObjectOutputStream(new DeflaterOutputStream(
44 serialObj, def));
45 objStream.writeObject(obj);
46 objStream.close();
47 return encodeBytes(serialObj.toByteArray());
48 } catch (Exception e) {
49 throw new IOException("Serialization error: " + e.getMessage(), e);
50 }
51 }
52
53 public static Object deserialize(String str) throws IOException {
54 if (str == null || str.length() == 0)

Callers 15

pushProjectionMethod · 0.95
pushProjectionMethod · 0.95
pushProjectionMethod · 0.95
getSchemaMethod · 0.95
testLimitVariable4Method · 0.95
testSortOrderMethod · 0.95
testComplex2Method · 0.95
pushProjectionMethod · 0.95
setLocationMethod · 0.95
testProjectNullBagMethod · 0.95
checkSchemaMethod · 0.95

Calls 4

encodeBytesMethod · 0.95
closeMethod · 0.65
writeObjectMethod · 0.45
getMessageMethod · 0.45

Tested by 9

testLimitVariable4Method · 0.76
testSortOrderMethod · 0.76
testComplex2Method · 0.76
pushProjectionMethod · 0.76
setLocationMethod · 0.76
testProjectNullBagMethod · 0.76
checkSchemaMethod · 0.76
testPredicatePushdownMethod · 0.76