Configuration conf = getConf();
//ThriftSerialization.enableThriftSerialization(conf);
HadoopSerialization hadoopSer = new HadoopSerialization(conf);
//defined in BaseTest
TupleMRConfig pangoolConf = buildPangoolConfig(withNulls);
List<Schema> intermediateSchemas = pangoolConf.getIntermediateSchemas();
TupleSerialization serialization = new TupleSerialization(hadoopSer, pangoolConf);
TupleSerializer serializer = (TupleSerializer) serialization.getSerializer(null);
TupleDeserializer deser = (TupleDeserializer) serialization.getDeserializer(null);
int NUM_ITERATIONS = 10000;
DatumWrapper<ITuple> wrapper = new DatumWrapper<ITuple>();
// Different schemas
for (int i = 0; i < NUM_ITERATIONS/2; i++) {
Tuple tuple = new Tuple(intermediateSchemas.get(i%intermediateSchemas.size()));
wrapper.datum(tuple);
fillTuple(true, wrapper.datum());
assertSerializable(serializer, deser, wrapper, false);
}
// Same schema
Tuple tuple = new Tuple(pangoolConf.getIntermediateSchema("schema"));
wrapper.datum(tuple);
for (int i = 0; i < NUM_ITERATIONS/2; i++) {
fillTuple(true, wrapper.datum());
assertSerializable(serializer, deser, wrapper, false);
}