Configuration newConf = new Configuration(conf);
newConf.setInt("io.seqfile.compress.blocksize", 100000);
FileSKVWriter out = new RFileOperations().openWriter(tmpFile, fs, newConf, ServerConfiguration.getSiteConfiguration());
InterruptibleIterator iter = map.skvIterator();
HashSet<ByteSequence> allfams= new HashSet<ByteSequence>();
for(Entry<String, Set<ByteSequence>> entry : lggroups.entrySet()){
allfams.addAll(entry.getValue());
out.startNewLocalityGroup(entry.getKey(), entry.getValue());
iter.seek(new Range(), entry.getValue(), true);
dumpLocalityGroup(out, iter);
}
out.startDefaultLocalityGroup();
iter.seek(new Range(), allfams, false);
dumpLocalityGroup(out, iter);
out.close();