private void checkExceptions(List<MutationsRejectedException> mres) throws MutationsRejectedException { if (mres == null || mres.isEmpty()) { return; } List<ConstraintViolationSummary> cvsList = new LinkedList<ConstraintViolationSummary>(); HashMap<KeyExtent,Set<SecurityErrorCode>> map = new HashMap<KeyExtent,Set<SecurityErrorCode>>(); Collection<String> serverSideErrors = new LinkedList<String>(); int unknownErrors = 0; for (MutationsRejectedException mre : mres) { cvsList.addAll(mre.getConstraintViolationSummaries()); map.putAll(mre.getAuthorizationFailuresMap()); serverSideErrors.addAll(mre.getErrorServers()); unknownErrors += mre.getUnknownExceptions(); } throw new MutationsRejectedException(null, cvsList, map, serverSideErrors, unknownErrors, null); }
public void close(Reporter reporter) throws IOException { LOG.debug("mutations written: {}, values written: {}", this.mutCount, this.valCount); if(!this.simulate) { try { this.mtbw.close(); } catch (MutationsRejectedException var7) { if(var7.getAuthorizationFailuresMap().size() > 0) { Map tables = new HashMap(); Map.Entry ke; Object secCodes; for(Iterator itr = var7.getAuthorizationFailuresMap().entrySet().iterator(); itr.hasNext(); ((Set)secCodes).addAll((Collection)ke.getValue())) { ke = (Map.Entry)itr.next(); secCodes = (Set)tables.get(((KeyExtent)ke.getKey()).getTableId().toString()); if(secCodes == null) { secCodes = new HashSet(); tables.put(((KeyExtent)ke.getKey()).getTableId().toString(), secCodes); } } LOG.error("Not authorized to write to tables {}", tables); } if(var7.getConstraintViolationSummaries().size() > 0) { LOG.error("Constraint violations : {}", var7.getConstraintViolationSummaries().size()); } throw new IOException(var7); } } } }
writer.close(); } catch (MutationsRejectedException e) { authFailures = e.getAuthorizationFailuresMap(); cvs = e.getConstraintViolationSummaries();