private void checkForFailures() throws MutationsRejectedException { if (somethingFailed) { List<ConstraintViolationSummary> cvsList = violations.asList(); HashMap<TabletId,Set<org.apache.accumulo.core.client.security.SecurityErrorCode>> af = new HashMap<>(); for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : authorizationFailures.entrySet()) { HashSet<org.apache.accumulo.core.client.security.SecurityErrorCode> codes = new HashSet<>(); for (SecurityErrorCode sce : entry.getValue()) { codes.add(org.apache.accumulo.core.client.security.SecurityErrorCode.valueOf(sce.name())); } af.put(new TabletIdImpl(entry.getKey()), codes); } throw new MutationsRejectedException(context, cvsList, af, serverSideErrors, unknownErrors, lastUnknownError); } }
try{ //... } catch (Exception e) { throw new MutationsRejectedException(null, null, (Map<TabletId,Set<SecurityErrorCode>>)null, null, 1, e); }
public static MutationsRejectedException fromThrift(org.apache.accumulo.proxy.thrift.MutationsRejectedException mre, Instance instance) { return new MutationsRejectedException(instance, null, null, Collections.singleton(mre.getMsg()), 0, mre); }
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); }
private void checkForFailures() throws MutationsRejectedException { if (somethingFailed) { List<ConstraintViolationSummary> cvsList = violations.asList(); HashMap<TabletId,Set<org.apache.accumulo.core.client.security.SecurityErrorCode>> af = new HashMap<>(); for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : authorizationFailures.entrySet()) { HashSet<org.apache.accumulo.core.client.security.SecurityErrorCode> codes = new HashSet<>(); for (SecurityErrorCode sce : entry.getValue()) { codes.add(org.apache.accumulo.core.client.security.SecurityErrorCode.valueOf(sce.name())); } af.put(new TabletIdImpl(entry.getKey()), codes); } throw new MutationsRejectedException(context.getInstance(), cvsList, af, serverSideErrors, unknownErrors, lastUnknownError); } }