if (mTargetURI.getTable() == null) {
// No table specified: delete Kiji instance:
return deleteInstance(mTargetURI);
}
final Kiji kiji = Kiji.Factory.open(mTargetURI, getConf());
try {
final List<KijiColumnName> columns = mTargetURI.getColumns(); // never null
if (null == mEntityIdFlag) {
// No specific row to delete or to delete from:
if (columns.isEmpty()) {
// No specific column targeted, delete the entire table:
return deleteTable(kiji, mTargetURI);
} else {
// Delete entire families/columns in the table:
throw new RuntimeException(
"Deleting entire families/columns across all rows is not implemented");
}
} else {
// Delete is targeting one specific row:
final KijiTable table = kiji.openTable(mTargetURI.getTable());
try {
final EntityId entityId =
ToolUtils.createEntityIdFromUserInputs(mEntityIdFlag, table.getLayout());
return deleteFromRow(table, entityId, columns, mTimestampMode, mTimestamp);
} finally {
table.release();
}
}
} finally {
kiji.release();
}
}