geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [1/3] geode git commit: GEODE-2277 logging tweaks
Date Mon, 09 Jan 2017 19:16:57 GMT
Repository: geode
Updated Branches:
  refs/heads/develop dfecdba2a -> 1eceed2eb


GEODE-2277 logging tweaks

Added beforeCreate() logging for PdxTypes.  The old logging was
incorrectly in beforeUpdate().


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/aa2f8387
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/aa2f8387
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/aa2f8387

Branch: refs/heads/develop
Commit: aa2f8387ab4553d273f4a72097b61cf77c727bd2
Parents: cbc312c
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Fri Jan 6 10:03:56 2017 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Mon Jan 9 11:11:01 2017 -0800

----------------------------------------------------------------------
 .../pdx/internal/PeerTypeRegistration.java      | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/aa2f8387/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
b/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
index cd09653..641d9f8 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
@@ -169,6 +169,18 @@ public class PeerTypeRegistration implements TypeRegistration {
     });
 
     factory.setCacheWriter(new CacheWriterAdapter<Object, Object>() {
+      
+      @Override
+      public void beforeCreate(EntryEvent<Object, Object> event) throws CacheWriterException
{
+        Object newValue = event.getNewValue();
+        if (newValue instanceof PdxType) {
+          logger.info("Adding type to PdxTypes: {}",
+              ((PdxType) event.getNewValue()).toFormattedString());
+        } else {
+          logger.info("Adding enum to PdxTypes: {} {}", event.getKey(),
+              ((EnumInfo)newValue).toFormattedString());
+        }
+      }
 
       @Override
       public void beforeUpdate(EntryEvent<Object, Object> event) throws CacheWriterException
{
@@ -178,15 +190,6 @@ public class PeerTypeRegistration implements TypeRegistration {
                   + event.getKey() + ", existing pdx type " + event.getOldValue() + ", new
type "
                   + event.getNewValue());
           throw new CacheWriterException(ex);
-        } else {
-          Object newValue = event.getNewValue();
-          if (newValue instanceof PdxType) {
-            logger.info("(CacheWriter) Adding type to PdxTypes: {}/{}", event.getKey(),
-                ((PdxType) event.getNewValue()).toFormattedString());
-          } else {
-            logger.info("(CacheWriter) Adding enum to PdxTypes: {}/{}", event.getKey(),
-                ((EnumInfo)newValue).toFormattedString());
-          }
         }
       }
 


Mime
View raw message