}
Arrays.sort(rands);
Configuration conf = CachedConfiguration.getInstance();
Writer mfw;
try {
FileSystem fs = FileSystem.get(conf);
mfw = new MyMapFile.Writer(conf, fs, file, Key.class, Value.class, CompressionType.BLOCK);
} catch (IOException e) {
throw new RuntimeException(e);
}
for (int i = 0; i < rands.length; i++) {
Text row = new Text(String.format("row_%010d", rands[i]));
Key key = new Key(row);
Value dv = new Value(createValue(rands[i], 40));
try {
mfw.append(key, dv);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
try {
mfw.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}