String msg = "Testing the spillage of spilling buffer";
Text text = new Text(msg);
TaskAttemptID id = new TaskAttemptID(new TaskID("123", 1, 2), 0);
SpillingQueue<Text> queue = new SpillingQueue<Text>();
Configuration conf = new HamaConfiguration();
String fileName = System.getProperty("java.io.tmpdir") + File.separatorChar
+ new BigInteger(128, new SecureRandom()).toString(32);
File file = new File(fileName);
conf.set(SpillingQueue.SPILLBUFFER_FILENAME, fileName);
conf.setClass(SpillingQueue.SPILLBUFFER_MSGCLASS, Text.class,
Writable.class);
queue.init(conf, id);
queue.prepareWrite();
for (int i = 0; i < 1000; ++i) {
queue.add(text);