* @return The kiji instance for the test environment.
*/
public Kiji build() throws IOException {
// Populate constants.
final Configuration conf = HBaseConfiguration.create();
final KijiURI uri = (mExistingKiji != null)
? mExistingKiji.getURI()
: KijiURI.newBuilder(
String.format("kiji://.fake.%d/%s", FAKE_COUNT.getAndIncrement(), mInstanceName))
.build();
// In-process MapReduce execution:
// TODO(KIJIMR-19): remove this, InstanceBuilder should not be concerned by configuration.
// This is a temporary fix until all job builders have a withConf() setter.
final String tmpDir = "file:///tmp/hdfs-testing-" + System.nanoTime();
conf.set("fs.default.FS", tmpDir);
conf.set("mapred.job.tracker", "local");
// Install & open a Kiji instance.
LOG.info(String.format("Building instance: %s", uri.toString()));
try {
if (mExistingKiji == null) {
KijiInstaller.get().install(uri, conf);
}
} catch (KijiInvalidNameException kine) {