// Read it back.
Kiji kiji = getKiji();
assertNotNull(kiji);
kiji.createTable(KijiTableLayouts.getLayout(KijiTableLayouts.SIMPLE_FORMATTED_EID));
KijiTable mTable = kiji.openTable("table");
try {
assertNotNull(mTable);
// Fill local variables.
KijiTableReader mReader = mTable.openTableReader();
try {
KijiTableWriter mWriter = mTable.openTableWriter();
try {
EntityId mEntityId = mTable.getEntityId("eid-foo");
mWriter.put(mEntityId, "family", "column", 0L, "Value at timestamp 0.");
mWriter.put(mEntityId, "family", "column", 1L, "Value at timestamp 1.");
final KijiDataRequest dataRequest = KijiDataRequest.builder()
.addColumns(
KijiDataRequestBuilder.ColumnsDef.create()
.withMaxVersions(2)
.add("family", "column"))
.build();
// Try this as a get.
KijiRowData rowData = mReader.get(mEntityId, dataRequest);
String s = rowData.getValue("family", "column", 0L).toString();
assertEquals(s, "Value at timestamp 0.");
// Delete the cell and make sure that this value is missing.
mWriter.deleteCell(mEntityId, "family", "column", 0L);
rowData = mReader.get(mEntityId, dataRequest);
assertFalse(rowData.containsCell("family", "column", 0L));
} finally {
mWriter.close();
}
} finally {
mReader.close();
}
} finally {
mTable.release();
}
}