FileSystem dfs = FileSystem.get(config);
BSPJob job = new BSPJob(new BSPJobID("checkpttest", 1), "/tmp");
TaskAttemptID taskId = new TaskAttemptID(new TaskID(job.getJobID(), 1), 1);
TestMessageManager messenger = new TestMessageManager();
PeerSyncClient syncClient = SyncServiceFactory.getPeerSyncClient(config);
@SuppressWarnings("rawtypes")
BSPPeer bspTask = new TestBSPPeer(job, config, taskId, new Counters(), -1L,
(BSPPeerSyncClient) syncClient, messenger, TaskStatus.State.RUNNING);
assertNotNull("BSPPeerImpl should not be null.", bspTask);
LOG.info("Created bsp peer and other parameters");
int port = BSPNetUtils.getFreePort(12502);
LOG.info("Got port = " + port);
boolean result = syncClient
.getInformation(syncClient.constructKey(job.getJobID(), "checkpoint",
"" + bspTask.getPeerIndex()), new ArrayWritable(LongWritable.class));
assertFalse(result);
bspTask.sync();