break;
case batch:
client.trimFormat("/%s"); // sleazy hack to remove trailing id
client.addFormat("/batch");
BaseFeed bf = parseFeed(client, is, maps, preview, pw);
pp(maps, client.createFeed(bf, uid, mid), pw);
break;
// Clear out a feed.
case clear:
client.trimFormat("/%s"); // sleazy hack to remove trailing id
bf = client.readFeed(uid, mid, fid);
client.addFormat("/batch");
BaseFeed batch = client.newFeed();
count = 0;
for (Object o : bf.getEntries()) {
String entryId = ((BaseEntry) o).getSelfLink().getHref();
if (count == 0 && fudge) {
entryId += "-xx";
}
BaseEntry delete = client.newEntry();
delete.setId(replaceUserId(uid, entryId));
BatchUtils.setBatchOperationType(delete, BatchOperationType.DELETE);
BatchUtils.setBatchId(delete, Integer.toString(++count));
batch.getEntries().add(delete);
}
if (preview) {
pp(maps, batch, pw);
}
BaseFeed response = maps.batch(client.makeUri(uid, mid, fid), batch);
pp(maps, response, pw);
break;
// Test bulk insert latency.
case bulk: