You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Galen O'Sullivan (JIRA)" <ji...@apache.org> on 2018/03/26 18:54:00 UTC

[jira] [Created] (GEODE-4944) Combine GemFireCacheImpl read-serialized methods

Galen O'Sullivan created GEODE-4944:
---------------------------------------

             Summary: Combine GemFireCacheImpl read-serialized methods
                 Key: GEODE-4944
                 URL: https://issues.apache.org/jira/browse/GEODE-4944
             Project: Geode
          Issue Type: Improvement
          Components: regions, serialization
            Reporter: Galen O'Sullivan


Currently, {{InternalCache}} / {{GemFireCacheImpl}} has multiple ways to set a thread-local read-serialized option, with no clear differentiation between them or indication of why a person would choose to use one instead of the other.
These two methods were added recently, in 4143a73:
{code}
  @Override
  public Boolean getPdxReadSerializedOverride() {
    TypeRegistry pdxRegistry = this.getPdxRegistry();
    if (pdxRegistry != null) {
      return pdxRegistry.getPdxReadSerializedOverride();
    }
    return false;
  }

  @Override
  public void setPdxReadSerializedOverride(boolean pdxReadSerialized) {
    TypeRegistry pdxRegistry = this.getPdxRegistry();
    if (pdxRegistry != null) {
      pdxRegistry.setPdxReadSerializedOverride(pdxReadSerialized);
    }
{code}
This has been around for a while, and does something slightly different:
{code}
  @Override
  public void setReadSerializedForCurrentThread(boolean value) {
    PdxInstanceImpl.setPdxReadSerialized(value);
    this.setPdxReadSerializedOverride(value);
  }
{code}
Perhaps we could even combine this method if it's obvious what it's doing (though that doesn't need to be a part of this method):
{code}
  // test hook
  @Override
  public void setReadSerializedForTest(boolean value) {
    this.cacheConfig.setPdxReadSerialized(value);
  }
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)