Search in sources :

Example 1 with SecurityErrorCode

use of org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode in project accumulo by apache.

the class TabletServerBatchWriter method updateAuthorizationFailures.

private void updateAuthorizationFailures(Set<KeyExtent> keySet, SecurityErrorCode code) {
    HashMap<KeyExtent, SecurityErrorCode> map = new HashMap<>();
    for (KeyExtent ke : keySet) map.put(ke, code);
    updateAuthorizationFailures(map);
}
Also used : HashMap(java.util.HashMap) SecurityErrorCode(org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode) KeyExtent(org.apache.accumulo.core.data.impl.KeyExtent)

Example 2 with SecurityErrorCode

use of org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode in project accumulo by apache.

the class TabletServerBatchWriter method checkForFailures.

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);
    }
}
Also used : Set(java.util.Set) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) HashMap(java.util.HashMap) SecurityErrorCode(org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode) TabletIdImpl(org.apache.accumulo.core.data.impl.TabletIdImpl) KeyExtent(org.apache.accumulo.core.data.impl.KeyExtent) ConstraintViolationSummary(org.apache.accumulo.core.data.ConstraintViolationSummary) TabletId(org.apache.accumulo.core.data.TabletId) HashSet(java.util.HashSet) MutationsRejectedException(org.apache.accumulo.core.client.MutationsRejectedException)

Aggregations

HashMap (java.util.HashMap)2 SecurityErrorCode (org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode)2 KeyExtent (org.apache.accumulo.core.data.impl.KeyExtent)2 HashSet (java.util.HashSet)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 MutationsRejectedException (org.apache.accumulo.core.client.MutationsRejectedException)1 ConstraintViolationSummary (org.apache.accumulo.core.data.ConstraintViolationSummary)1 TabletId (org.apache.accumulo.core.data.TabletId)1 TabletIdImpl (org.apache.accumulo.core.data.impl.TabletIdImpl)1