However, the (MultiTable)BatchWriter throws a MutationsRejectedException that has the KeyExtent->ErrorCode pairings (as John pointed out) but I do not see an effective way map KeyExtent.tableId to a tableName (that the client would probably prefer) since the MRE doesn't have access to the instance. Any ideas?
I looked around the code to see where else KeyExtent was used in the public API. o.a.a.c.client.admin.ActiveScan and ActiveCompaction expose KeyExtent to the user. Howerver these classes also provide getTable() methods which return the table name. The implementation of these methods use code that is not part of the public API.
The javadoc for MRE.getAuthorizationFailures() could point users to TableOperations.tableIdMap(). However, this map is not readily usable, because its keyed on table name. So I guess basically we need an easy way for users to map table ids to table names thats in the public API. If this existed, then the javadoc for MRE could point to it. Maybe add something to TableOperations that returns a map keyed on table id? I looked for a built in java util in Collections that would invert a map and did not see anything. If there was a simple way to invert the map, then we would not need to add anything to the public API, just add some javadoc pointing out this inversion util.
Another possibility is adding a convenience method "String getTableName(Instance i)" to KeyExtent. This addresses the issue at hand, but I think a more general solution in TableOperations would be better.