/** * Helper method to kill a tablet server that serves the given tablet's * leader. The currently running test case will be failed if the tablet has no * leader after some retries, or if the tablet server was already killed. * * This method is thread-safe. * @param tablet a RemoteTablet which will get its leader killed * @throws Exception */ public void killTabletLeader(RemoteTablet tablet) throws Exception { killTabletLeader(new LocatedTablet(tablet)); }
entry.getUpperBoundPartitionKey())); return Deferred.fromResult(new LocatedTablet(entry.getTablet()));
/** * Kills a tablet server that serves the given tablet's leader and restarts it. * @param tablet a RemoteTablet which will get its leader killed and restarted * @throws Exception */ public void restartTabletServer(RemoteTablet tablet) throws Exception { HostAndPort hp = findLeaderTabletServer(new LocatedTablet(tablet)); miniCluster.killTabletServer(hp); miniCluster.startTabletServer(hp); }
@Override public Deferred<LocatedTablet> call(List<LocatedTablet> tablets) { Preconditions.checkArgument(tablets.size() <= 1, "found more than one tablet for a single partition key"); if (tablets.isEmpty()) { // Most likely this indicates a non-covered range, but since this // could race with an alter table partitioning operation (which // clears the local table locations cache), we check again. TableLocationsCache.Entry entry = getTableLocationEntry(table.getTableId(), partitionKey); if (entry == null) { // This should be extremely rare, but a potential source of tight loops. LOG.debug("Table location expired before it could be processed; retrying."); return Deferred.fromError(new RecoverableException(Status.NotFound( "Table location expired before it could be processed"))); } if (entry.isNonCoveredRange()) { return Deferred.fromError( new NonCoveredRangeException(entry.getLowerBoundPartitionKey(), entry.getUpperBoundPartitionKey())); } return Deferred.fromResult(new LocatedTablet(entry.getTablet())); } return Deferred.fromResult(tablets.get(0)); } });
ret.add(new LocatedTablet(entry.getTablet()));