@Override
    public void preGetOp(final ObserverContext<? extends RegionCoprocessorEnvironment> e,
      final Get get, final List<Cell> results) throws IOException {

      int replicaId = e.getEnvironment().getRegion().getRegionInfo().getReplicaId();

      // Fail for the primary replica, but not for meta
      if (throwException) {
        if (!e.getEnvironment().getRegion().getRegionInfo().isMetaRegion() && (replicaId == 0)) {
          LOG.info("Get, throw Region Server Stopped Exceptoin for region "
            + e.getEnvironment().getRegion().getRegionInfo());
          throw new RegionServerStoppedException(
            "Server " + e.getEnvironment().getServerName() + " not running");
        }
      } else {
        LOG.info("Get, We're replica region " + replicaId);
      }
    }
This copro is used to slow down the primary meta region scan a bit
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java