class AbstractPeerTXRegionStub implements TXRegionStub {

  @Override
  public Set getRegionKeysForIteration() {
    try {
      RemoteFetchKeysMessage.FetchKeysResponse response =
          RemoteFetchKeysMessage.send((LocalRegion) getRegion(), state.getTarget());
      return response.waitForKeys();
    } catch (RegionDestroyedException regionDestroyedException) {
      throw new TransactionDataNotColocatedException(
          String.format("Region %s not colocated with other regions in transaction",
              regionDestroyedException.getRegionFullPath()),
          regionDestroyedException);
    } catch (CacheClosedException cacheClosedException) {
      throw new TransactionDataNodeHasDepartedException("Cache was closed while fetching keys");
    } catch (TransactionException transactionException) {
      throw transactionException;
    } catch (Exception exception) {
      throw new TransactionException(exception);
    }
  }

  public  AbstractPeerTXRegionStub(TXStateStub txstate);

}