@Override public TabletId getTablet() { return new TabletIdImpl(extent); }
@Override public TabletId apply(org.apache.accumulo.core.data.KeyExtent input) { // the following if null check is to appease findbugs... grumble grumble spent a good part of // my morning looking into this // http://sourceforge.net/p/findbugs/bugs/1139/ // https://code.google.com/p/guava-libraries/issues/detail?id=920 if (input == null) return null; return new TabletIdImpl(input); } };
public TabletId getTabletId() { return new TabletIdImpl(extent); }
private static TabletId newTabletId(String tableId, String endRow, String prevRow) { return new TabletIdImpl(new KeyExtent(tableId, endRow == null ? null : new Text(endRow), prevRow == null ? null : new Text(prevRow))); }
public LoctionsImpl(Map<String,Map<KeyExtent,List<Range>>> binnedRanges) { groupedByTablets = new HashMap<>(); groupedByRanges = null; tabletLocations = new HashMap<>(); for (Entry<String,Map<KeyExtent,List<Range>>> entry : binnedRanges.entrySet()) { String location = entry.getKey(); for (Entry<KeyExtent,List<Range>> entry2 : entry.getValue().entrySet()) { TabletIdImpl tabletId = new TabletIdImpl(entry2.getKey()); tabletLocations.put(tabletId, location); List<Range> prev = groupedByTablets.put(tabletId, Collections.unmodifiableList(entry2.getValue())); if (prev != null) { throw new RuntimeException( "Unexpected : tablet at multiple locations : " + location + " " + tabletId); } } } groupedByTablets = Collections.unmodifiableMap(groupedByTablets); }
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); } }
@Override public TabletId getTablet() { return new TabletIdImpl(new KeyExtent(tac.getExtent())); }