@Test public void testBinSplit() throws Exception { for (int i = 0; i < 3; i++) { KeyExtent ke1 = nke("foo", null, null); TServers tservers = new TServers(); TabletLocatorImpl metaCache = createLocators(tservers, "tserver1", "tserver2", "foo", ke1, "l1"); List<Mutation> ml = nml(nm("a", "cf1:cq1=v1", "cf1:cq2=v2"), nm("m", "cf1:cq1=v3", "cf1:cq2=v4"), nm("z", "cf1:cq1=v5")); Map<String,Map<KeyExtent,List<String>>> emb = cemb(nol("a", "l1", ke1), nol("m", "l1", ke1), nol("z", "l1", ke1)); if (i == 0 || i == 2) runTest(metaCache, ml, emb); List<Range> ranges = nrl(new Range(new Text("a")), new Range(new Text("m")), new Range(new Text("z"))); Map<String,Map<KeyExtent,List<Range>>> expected1 = createExpectedBinnings("l1", nol(nke("foo", null, null), ranges) ); if (i == 1 || i == 2) runTest(ranges, metaCache, expected1); KeyExtent ke11 = nke("foo", "n", null); KeyExtent ke12 = nke("foo", null, "n"); setLocation(tservers, "tserver2", MTE, ke12, "l2"); metaCache.invalidateCache(ke1); emb = cemb(nol("z", "l2", ke12)); if (i == 0 || i == 2) runTest(metaCache, ml, emb, "a", "m"); Map<String,Map<KeyExtent,List<Range>>> expected2 = createExpectedBinnings("l2", nol(nke("foo", null, "n"), nrl(new Range(new Text("z")))) ); if (i == 1 || i == 2) runTest(ranges, metaCache, expected2, nrl(new Range(new Text("a")), new Range(new Text("m")))); setLocation(tservers, "tserver2", MTE, ke11, "l3"); emb = cemb(nol("a", "l3", ke11), nol("m", "l3", ke11), nol("z", "l2", ke12)); if (i == 0 || i == 2) runTest(metaCache, ml, emb); Map<String, Map<KeyExtent,List<Range>>> expected3 = createExpectedBinnings("l2", nol(nke("foo", null, "n"), nrl(new Range(new Text("z")))), "l3", nol(nke("foo", "n", null), nrl(new Range(new Text("a")), new Range(new Text("m")))) ); if (i == 1 || i == 2) runTest(ranges, metaCache, expected3); } }
@Override public void invalidateCache(KeyExtent failedExtent) { wLock.lock(); try { badExtents.add(failedExtent); } finally { wLock.unlock(); } if (log.isTraceEnabled()) log.trace("Invalidated extent={}", failedExtent); }
TabletLocatorImpl extends TabletLocator { @Override public void invalidateCache(KeyExtent failedExtent) { wLock.lock(); try { badExtents.add(failedExtent); } finally { wLock.unlock(); } if (log.isTraceEnabled()) log.trace("Invalidated extent={}", failedExtent); } }
TabletLocatorImpl extends TabletLocator { @Override public void invalidateCache(KeyExtent failedExtent) { wLock.lock(); try { badExtents.add(failedExtent); } finally { wLock.unlock(); } if (log.isTraceEnabled()) log.trace("Invalidated extent={}", failedExtent); } TabletLocatorImpl(TableId tableId, TabletLocator parent, TabletLocationObtainer tlo,
      TabletServerLockChecker tslc); }
TabletLocatorImpl extends TabletLocator { @Override public void invalidateCache(KeyExtent failedExtent) { wLock.lock(); try { badExtents.add(failedExtent); } finally { wLock.unlock(); } if (log.isTraceEnabled()) log.trace("Invalidated extent={}", failedExtent); } TabletLocatorImpl(TableId tableId, TabletLocator parent, TabletLocationObtainer tlo,
      TabletServerLockChecker tslc); @Override void binMutations(ClientContext context, List<T> mutations,
      Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures); @Override List<Range> binRanges(ClientContext context, List<Range> ranges,
      Map<String,Map<KeyExtent,List<Range>>> binnedRanges); @Override void invalidateCache(KeyExtent failedExtent); @Override void invalidateCache(Collection<KeyExtent> keySet); @Override void invalidateCache(ClientContext context, String server); @Override void invalidateCache(); @Override TabletLocation locateTablet(ClientContext context, Text row, boolean skipRow,
      boolean retry); }
TabletLocatorImpl extends TabletLocator { @Override public void invalidateCache(KeyExtent failedExtent) { wLock.lock(); try { badExtents.add(failedExtent); } finally { wLock.unlock(); } if (log.isTraceEnabled()) log.trace("Invalidated extent={}", failedExtent); } TabletLocatorImpl(TableId tableId, TabletLocator parent, TabletLocationObtainer tlo,
      TabletServerLockChecker tslc); @Override void binMutations(ClientContext context, List<T> mutations,
      Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures); @Override List<Range> binRanges(ClientContext context, List<Range> ranges,
      Map<String,Map<KeyExtent,List<Range>>> binnedRanges); @Override void invalidateCache(KeyExtent failedExtent); @Override void invalidateCache(Collection<KeyExtent> keySet); @Override void invalidateCache(ClientContext context, String server); @Override void invalidateCache(); @Override TabletLocation locateTablet(ClientContext context, Text row, boolean skipRow,
      boolean retry);  }