You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/11/17 19:17:11 UTC

usergrid git commit: Adds more logging

Repository: usergrid
Updated Branches:
  refs/heads/release 06c9c1012 -> a33f616be


Adds more logging


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

Branch: refs/heads/release
Commit: a33f616beed86f475999a5904520776494891968
Parents: 06c9c10
Author: Todd Nine <tn...@apigee.com>
Authored: Tue Nov 17 11:17:07 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Tue Nov 17 11:17:07 2015 -0700

----------------------------------------------------------------------
 .../impl/shard/impl/NodeShardAllocationImpl.java            | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/a33f616b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
index 0cc12b6..d52f807 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
@@ -138,11 +138,13 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
          * Nothing to do, it's been created very recently, we don't create a new one
          */
         if ( shardEntryGroup.isCompactionPending() ) {
+            LOG.trace( "Shard entry group {} is compacting, not auditing", shardEntryGroup );
             return false;
         }
 
         //we can't allocate, we have more than 1 write shard currently.  We need to compact first
         if ( shardEntryGroup.entrySize() != 1 ) {
+            LOG.trace( "Shard entry group {} does not have 1 entry, not allocating", shardEntryGroup );
             return false;
         }
 
@@ -151,9 +153,12 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
          * Check the min shard in our system
          */
         final Shard shard = shardEntryGroup.getMinShard();
+        final long minTime = getMinTime();
 
 
-        if ( shard.getCreatedTime() >= getMinTime() ) {
+
+        if ( shard.getCreatedTime() >= minTime ) {
+            LOG.trace( "Shard entry group {}  and shard {} is before the minimum created time of {}.  Not allocating.does not have 1 entry, not allocating", shardEntryGroup, shard, minTime );
             return false;
         }
 
@@ -253,7 +258,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
     @Override
     public long getMinTime() {
 
-        final long minimumAllowed = 2 * graphFig.getShardCacheTimeout();
+        final long minimumAllowed = ( long ) (2.5 * graphFig.getShardCacheTimeout());
 
         final long minDelta = graphFig.getShardMinDelta();