*
* @param kijiURI The KijiURI to create the table in.
* @throws Exception If there is an error.
*/
public void createAndPopulateFooTable(KijiURI kijiURI) throws Exception {
final Kiji kiji = Kiji.Factory.open(kijiURI, getConf());
try {
final KijiTableLayout layout = KijiTableLayouts.getTableLayout(KijiTableLayouts.FOO_TEST);
final long timestamp = System.currentTimeMillis();
new InstanceBuilder(kiji)
.withTable(layout.getName(), layout)
.withRow("gwu@usermail.example.com")
.withFamily("info")
.withQualifier("email").withValue(timestamp, "gwu@usermail.example.com")
.withQualifier("name").withValue(timestamp, "Garrett Wu")
.withRow("aaron@usermail.example.com")
.withFamily("info")
.withQualifier("email").withValue(timestamp, "aaron@usermail.example.com")
.withQualifier("name").withValue(timestamp, "Aaron Kimball")
.withRow("christophe@usermail.example.com")
.withFamily("info")
.withQualifier("email")
.withValue(timestamp, "christophe@usermail.example.com")
.withQualifier("name").withValue(timestamp, "Christophe Bisciglia")
.withRow("kiyan@usermail.example.com")
.withFamily("info")
.withQualifier("email").withValue(timestamp, "kiyan@usermail.example.com")
.withQualifier("name").withValue(timestamp, "Kiyan Ahmadizadeh")
.withRow("john.doe@gmail.com")
.withFamily("info")
.withQualifier("email").withValue(timestamp, "john.doe@gmail.com")
.withQualifier("name").withValue(timestamp, "John Doe")
.withRow("jane.doe@gmail.com")
.withFamily("info")
.withQualifier("email").withValue(timestamp, "jane.doe@gmail.com")
.withQualifier("name").withValue(timestamp, "Jane Doe")
.build();
} finally {
kiji.release();
}
// Create the temp files needed to populate the foo table.
final File dataFile = File.createTempFile("data", ".csv");
dataFile.deleteOnExit();