geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirk Lund <kl...@apache.org>
Subject Re: Trying to cleanup dunit use of client cache
Date Fri, 09 Mar 2018 23:39:35 GMT
And I can't invoke createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT)
because ClientCache throws UnsupportedOperationException for it...

  /**
   * @since GemFire 6.5
   */
  @Override
  public <K, V> RegionFactory<K, V> createRegionFactory(RegionShortcut
shortcut) {
    if (isClient()) {
      throw new UnsupportedOperationException("operation is not supported
on a client cache");
    } else {
      return new RegionFactoryImpl<>(this, shortcut);
    }
  }

...which means you can only use deprecated code in the client unless you
don't create a ClientCache.

On Fri, Mar 9, 2018 at 3:32 PM, Kirk Lund <klund@apache.org> wrote:

> I keep running into things that the dunit tests are doing in a client
> cache that cannot be done with non-deprecated APIs.
>
> Is there a non-deprecated way to create a PERSISTENT_REPLICATE region in
> a client cache?
>
>       AttributesFactory factory = new AttributesFactory();
>       factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
>       factory.setPoolName(pool.getName());
>       factory.setScope(Scope.DISTRIBUTED_ACK);
>
> ...compared to...
>
>       ClientRegionFactory crf = clientCacheRule.getClientCache().
> createClientRegionFactory(ClientRegionShortcut.NOTHING_FITS);
>       crf.setPoolName(pool.getName());
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message