Search in sources :

Example 1 with TabletIdImpl

use of org.apache.accumulo.core.dataImpl.TabletIdImpl in project accumulo by apache.

the class BalanceParamsImpl method addMigration.

public void addMigration(KeyExtent extent, TServerInstance oldServer, TServerInstance newServer) {
    TabletId id = new TabletIdImpl(extent);
    TabletServerId oldTsid = new TabletServerIdImpl(oldServer);
    TabletServerId newTsid = new TabletServerIdImpl(newServer);
    migrationsOut.add(new TabletMigration(id, oldTsid, newTsid));
}
Also used : TabletMigration(org.apache.accumulo.core.spi.balancer.data.TabletMigration) TabletServerId(org.apache.accumulo.core.spi.balancer.data.TabletServerId) TabletId(org.apache.accumulo.core.data.TabletId) TabletIdImpl(org.apache.accumulo.core.dataImpl.TabletIdImpl)

Example 2 with TabletIdImpl

use of org.apache.accumulo.core.dataImpl.TabletIdImpl 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, 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.clientImpl.thrift.SecurityErrorCode) TabletIdImpl(org.apache.accumulo.core.dataImpl.TabletIdImpl) KeyExtent(org.apache.accumulo.core.dataImpl.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

TabletId (org.apache.accumulo.core.data.TabletId)2 TabletIdImpl (org.apache.accumulo.core.dataImpl.TabletIdImpl)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 MutationsRejectedException (org.apache.accumulo.core.client.MutationsRejectedException)1 SecurityErrorCode (org.apache.accumulo.core.clientImpl.thrift.SecurityErrorCode)1 ConstraintViolationSummary (org.apache.accumulo.core.data.ConstraintViolationSummary)1 KeyExtent (org.apache.accumulo.core.dataImpl.KeyExtent)1 TabletMigration (org.apache.accumulo.core.spi.balancer.data.TabletMigration)1 TabletServerId (org.apache.accumulo.core.spi.balancer.data.TabletServerId)1