@Override public void close(Reporter reporter) throws IOException { log.debug("mutations written: " + mutCount + ", values written: " + valCount); if (simulate) return; try { mtbw.close(); } catch (MutationsRejectedException e) { if (e.getSecurityErrorCodes().size() >= 0) { HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<>(); for (Entry<TabletId,Set<SecurityErrorCode>> ke : e.getSecurityErrorCodes().entrySet()) { String tableId = ke.getKey().getTableId().toString(); Set<SecurityErrorCode> secCodes = tables.get(tableId); if (secCodes == null) { secCodes = new HashSet<>(); tables.put(tableId, secCodes); } secCodes.addAll(ke.getValue()); } log.error("Not authorized to write to tables : " + tables); } if (e.getConstraintViolationSummaries().size() > 0) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size()); } throw new IOException(e); } finally { client.close(); } } }
@Override public void close(TaskAttemptContext attempt) throws IOException, InterruptedException { log.debug("mutations written: " + mutCount + ", values written: " + valCount); if (simulate) return; try { mtbw.close(); } catch (MutationsRejectedException e) { if (e.getSecurityErrorCodes().size() >= 0) { HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<>(); for (Entry<TabletId,Set<SecurityErrorCode>> ke : e.getSecurityErrorCodes().entrySet()) { String tableId = ke.getKey().getTableId().toString(); Set<SecurityErrorCode> secCodes = tables.get(tableId); if (secCodes == null) { secCodes = new HashSet<>(); tables.put(tableId, secCodes); } secCodes.addAll(ke.getValue()); } log.error("Not authorized to write to tables : " + tables); } if (e.getConstraintViolationSummaries().size() > 0) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size()); } throw new IOException(e); } finally { client.close(); } } }
@Override public boolean hasNext() { if (!getScannerIterator().hasNext() || !more) { try { writer.close(); } catch (MutationsRejectedException e) { log.error(e.toString()); if (Shell.isDebuggingEnabled()) for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries()) log.trace(cvs.toString()); } return false; } return true; }
lines.add("\t\t" + entry); if (!e.getConstraintViolationSummaries().isEmpty()) { lines.add("\tConstraint Failures:"); for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries()) { lines.add("\t\t" + cvs);
log.error(e.toString()); if (Shell.isDebuggingEnabled()) for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries()) log.trace(cvs.toString());
@Override public void close(Reporter reporter) throws IOException { log.debug("mutations written: " + mutCount + ", values written: " + valCount); if (simulate) return; try { mtbw.close(); } catch (MutationsRejectedException e) { if (e.getSecurityErrorCodes().size() >= 0) { HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<>(); for (Entry<TabletId,Set<SecurityErrorCode>> ke : e.getSecurityErrorCodes().entrySet()) { String tableId = ke.getKey().getTableId().toString(); Set<SecurityErrorCode> secCodes = tables.get(tableId); if (secCodes == null) { secCodes = new HashSet<>(); tables.put(tableId, secCodes); } secCodes.addAll(ke.getValue()); } log.error("Not authorized to write to tables : " + tables); } if (e.getConstraintViolationSummaries().size() > 0) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size()); } throw new IOException(e); } } }
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); }
@Override public void close(TaskAttemptContext attempt) throws IOException, InterruptedException { log.debug("mutations written: " + mutCount + ", values written: " + valCount); if (simulate) return; try { mtbw.close(); } catch (MutationsRejectedException e) { if (e.getSecurityErrorCodes().size() >= 0) { HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<>(); for (Entry<TabletId,Set<SecurityErrorCode>> ke : e.getSecurityErrorCodes().entrySet()) { String tableId = ke.getKey().getTableId().toString(); Set<SecurityErrorCode> secCodes = tables.get(tableId); if (secCodes == null) { secCodes = new HashSet<>(); tables.put(tableId, secCodes); } secCodes.addAll(ke.getValue()); } log.error("Not authorized to write to tables : " + tables); } if (e.getConstraintViolationSummaries().size() > 0) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size()); } throw new IOException(e); } } }
@Override public void close(Reporter reporter) throws IOException { log.debug("mutations written: " + mutCount + ", values written: " + valCount); if (simulate) return; try { mtbw.close(); } catch (MutationsRejectedException e) { if (e.getSecurityErrorCodes().size() >= 0) { HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<>(); for (Entry<TabletId,Set<SecurityErrorCode>> ke : e.getSecurityErrorCodes().entrySet()) { String tableId = ke.getKey().getTableId().toString(); Set<SecurityErrorCode> secCodes = tables.get(tableId); if (secCodes == null) { secCodes = new HashSet<>(); tables.put(tableId, secCodes); } secCodes.addAll(ke.getValue()); } log.error("Not authorized to write to tables : " + tables); } if (e.getConstraintViolationSummaries().size() > 0) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size()); } throw new IOException(e); } } }
@Override public void close(TaskAttemptContext attempt) throws IOException, InterruptedException { log.debug("mutations written: " + mutCount + ", values written: " + valCount); if (simulate) return; try { mtbw.close(); } catch (MutationsRejectedException e) { if (e.getSecurityErrorCodes().size() >= 0) { HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<>(); for (Entry<TabletId,Set<SecurityErrorCode>> ke : e.getSecurityErrorCodes().entrySet()) { String tableId = ke.getKey().getTableId().toString(); Set<SecurityErrorCode> secCodes = tables.get(tableId); if (secCodes == null) { secCodes = new HashSet<>(); tables.put(tableId, secCodes); } secCodes.addAll(ke.getValue()); } log.error("Not authorized to write to tables : " + tables); } if (e.getConstraintViolationSummaries().size() > 0) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size()); } throw new IOException(e); } } }
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); } } } }
if (e.getConstraintViolationSummaries().size() > 0) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size());
if (e.getConstraintViolationSummaries().size() > 0) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size());
if (!e.getConstraintViolationSummaries().isEmpty()) { log.error("Constraint violations : " + e.getConstraintViolationSummaries().size());
@Override public boolean hasNext() { if (!getScannerIterator().hasNext() || !more) { try { writer.close(); } catch (MutationsRejectedException e) { log.error(e.toString()); if (Shell.isDebuggingEnabled()) for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries()) log.trace(cvs.toString()); } return false; } return true; }
if (e.getConstraintViolationSummaries().size() > 0) { System.err.println("ERROR : Constraint violations occurred : " + e.getConstraintViolationSummaries());
lines.add("\t\t" + entry); if (e.getConstraintViolationSummaries().isEmpty() == false) { lines.add("\tConstraint Failures:"); for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries()) { lines.add("\t\t" + cvs.toString());
List<ConstraintViolationSummary> cvsl = mre.getConstraintViolationSummaries();
log.error(e.toString()); if (Shell.isDebuggingEnabled()) for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries()) log.trace(cvs.toString());
@Test public void testMaxMutationConstraint() throws Exception { String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName); c.tableOperations().addConstraint(tableName, MaxMutationSize.class.getName()); TestIngest.Opts opts = new TestIngest.Opts(); opts.rows = 1; opts.cols = 1000; opts.setTableName(tableName); if (saslEnabled) { opts.updateKerberosCredentials(cluster.getClientConfig()); } else { opts.setPrincipal(getAdminPrincipal()); } try { TestIngest.ingest(c, opts, bwOpts); } catch (MutationsRejectedException ex) { assertEquals(1, ex.getConstraintViolationSummaries().size()); } }