You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by mr...@apache.org on 2016/01/07 17:36:01 UTC
[6/7] usergrid git commit: added 'isDebugEnabled' and 'isTraceEnbled'
around logging calls.
added 'isDebugEnabled' and 'isTraceEnbled' around logging calls.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/af9d81e0
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/af9d81e0
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/af9d81e0
Branch: refs/heads/master
Commit: af9d81e0bc8ea95090e2f4dc29d7333c4d7bb706
Parents: 8cd49bb
Author: Jeff West <jw...@apigee.com>
Authored: Wed Jan 6 10:47:13 2016 -0800
Committer: Jeff West <jw...@apigee.com>
Committed: Wed Jan 6 10:47:13 2016 -0800
----------------------------------------------------------------------
.../batch/service/JobSchedulerService.java | 20 +-
.../batch/service/SchedulerServiceImpl.java | 16 +-
.../corepersistence/ApplicationIdCacheImpl.java | 4 +-
.../corepersistence/CpEntityManager.java | 26 +-
.../corepersistence/CpEntityManagerFactory.java | 13 +-
.../corepersistence/CpRelationManager.java | 37 +-
.../usergrid/corepersistence/CpWalker.java | 20 +-
.../usergrid/corepersistence/GuiceFactory.java | 4 +-
.../asyncevents/AmazonAsyncEventService.java | 9 +-
.../asyncevents/EventBuilderImpl.java | 29 +-
.../corepersistence/index/IndexServiceImpl.java | 12 +-
.../read/traverse/AbstractReadGraphFilter.java | 4 +-
.../read/traverse/EntityLoadVerifyFilter.java | 4 +-
.../results/ObservableQueryExecutor.java | 9 +-
.../service/ConnectionServiceImpl.java | 16 +-
.../usergrid/count/CassandraCounterStore.java | 9 +-
.../singlenode/SingleNodeLockManagerImpl.java | 6 +-
.../usergrid/mq/cassandra/QueueManagerImpl.java | 8 +-
.../mq/cassandra/io/AbstractSearch.java | 4 +-
.../mq/cassandra/io/ConsumerTransaction.java | 16 +-
.../org/apache/usergrid/persistence/Schema.java | 10 +-
.../cassandra/CassandraPersistenceUtils.java | 6 +-
.../persistence/cassandra/CassandraService.java | 8 +-
.../persistence/cassandra/CounterUtils.java | 10 +-
.../cassandra/util/TraceTagAspect.java | 11 +-
.../cassandra/util/TraceTagManager.java | 8 +-
.../org/apache/usergrid/utils/JsonUtils.java | 12 +-
.../usergrid/batch/job/TestJobListener.java | 12 +-
.../usergrid/persistence/RebuildIndexTest.java | 17 +-
.../query/IntersectionUnionPagingIT.java | 4 +-
.../astyanax/MultiKeyColumnNameIterator.java | 2 +-
.../core/astyanax/MultiRowColumnIterator.java | 16 +-
.../persistence/core/rx/ObservableIterator.java | 2 +-
.../persistence/core/rx/OrderedMerge.java | 4 +-
.../shard/impl/NodeShardAllocationImpl.java | 10 +-
.../shard/impl/ShardGroupColumnIterator.java | 10 +-
.../impl/shard/impl/ShardGroupDeletionImpl.java | 30 +-
.../impl/shard/impl/ShardsColumnIterator.java | 8 +-
.../usergrid/rest/AbstractContextResource.java | 14 +-
.../org/apache/usergrid/rest/RootResource.java | 5 +-
.../rest/applications/ApplicationResource.java | 47 +-
.../notifiers/NotifierResource.java | 4 +-
.../notifiers/NotifiersResource.java | 4 +-
.../rest/applications/users/UserResource.java | 4 +-
.../rest/applications/users/UsersResource.java | 2 +-
.../exceptions/AbstractExceptionMapper.java | 1 +
.../rest/filters/ContentTypeFilter.java | 18 +-
.../rest/management/ManagementResource.java | 8 +-
.../organizations/OrganizationResource.java | 20 +-
.../organizations/OrganizationsResource.java | 12 +-
.../applications/ApplicationResource.java | 8 +-
.../applications/ApplicationsResource.java | 4 +-
.../applications/imports/ImportsResource.java | 6 +-
.../rest/management/users/UserResource.java | 4 +-
.../rest/management/users/UsersResource.java | 4 +-
.../organizations/OrganizationResource.java | 4 +-
.../security/SecuredResourceFilterFactory.java | 55 +-
.../shiro/filters/BasicAuthSecurityFilter.java | 4 +-
.../ClientCredentialsSecurityFilter.java | 4 +-
.../OAuth2AccessTokenSecurityFilter.java | 5 +-
.../usergrid/rest/system/MigrateResource.java | 4 +-
.../applications/queries/GeoPagingTest.java | 4 +-
.../rest/management/ImportResourceIT.java | 4 +-
.../rest/test/resource/ClientSetup.java | 75 +--
.../resource/endpoints/CollectionEndpoint.java | 20 +-
.../endpoints/mgmt/ApplicationResource.java | 8 +-
.../resource/endpoints/mgmt/OrgResource.java | 9 +-
.../management/AppInfoMigrationPlugin.java | 6 +-
.../cassandra/ManagementServiceImpl.java | 3 +
.../management/importer/ImportServiceImpl.java | 547 ++++++++++---------
.../management/importer/S3ImportImpl.java | 5 +-
.../security/providers/FacebookProvider.java | 1 +
.../apache/usergrid/security/shiro/Realm.java | 18 +-
.../usergrid/security/shiro/ShiroCache.java | 12 +-
.../principals/ApplicationUserPrincipal.java | 4 +-
.../shiro/principals/PrincipalIdentifier.java | 8 +-
.../security/shiro/utils/SubjectUtils.java | 4 +-
.../services/AbstractCollectionService.java | 7 +
.../services/AbstractConnectionsService.java | 6 +-
.../usergrid/services/AbstractService.java | 9 +-
.../usergrid/services/ServiceManager.java | 14 +-
.../usergrid/services/ServiceRequest.java | 4 +-
.../usergrid/services/ServiceResults.java | 8 +-
.../services/activities/ActivitiesService.java | 4 +-
.../applications/ApplicationsService.java | 8 +-
.../usergrid/services/assets/AssetsService.java | 12 +-
.../assets/data/AwsSdkS3BinaryStore.java | 4 +-
.../services/assets/data/S3BinaryStore.java | 26 +-
.../services/devices/DevicesService.java | 8 +-
.../services/devices/users/UsersService.java | 4 +-
.../usergrid/services/groups/GroupsService.java | 8 +-
.../groups/activities/ActivitiesService.java | 4 +-
.../services/groups/roles/RolesService.java | 4 +-
.../services/groups/users/UsersService.java | 4 +-
.../users/activities/ActivitiesService.java | 4 +-
.../groups/users/devices/DevicesService.java | 4 +-
.../services/messages/MessagesService.java | 4 +-
.../notifications/InactiveDeviceManager.java | 4 +-
.../services/notifications/TaskManager.java | 34 +-
.../services/notifications/TestAdapter.java | 10 +-
.../notifications/apns/APNsAdapter.java | 4 +-
.../impl/ApplicationQueueManagerImpl.java | 12 +-
.../services/queues/ImportQueueListener.java | 4 +-
.../usergrid/services/roles/RolesService.java | 4 +-
.../services/roles/groups/GroupsService.java | 4 +-
.../services/roles/users/UsersService.java | 4 +-
.../usergrid/services/users/UsersService.java | 4 +-
.../users/activities/ActivitiesService.java | 4 +-
.../services/users/devices/DevicesService.java | 8 +-
.../services/users/groups/GroupsService.java | 4 +-
.../migration/AppInfoMigrationPluginTest.java | 8 +-
.../management/export/ExportServiceIT.java | 4 +-
.../management/importer/ImportServiceIT.java | 17 +-
113 files changed, 1102 insertions(+), 588 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java b/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
index 284e1db..ce6422c 100644
--- a/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
@@ -113,13 +113,17 @@ public class JobSchedulerService extends AbstractScheduledService {
int capacity = capacitySemaphore.availablePermits();
- LOG.debug( "Capacity is {}", capacity );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Capacity is {}", capacity);
+ }
activeJobs = jobAccessor.getJobs( capacity );
// nothing to do, we don't have any jobs to run
if ( activeJobs.size() == 0 ) {
- LOG.debug( "No jobs returned. Exiting run loop" );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("No jobs returned. Exiting run loop");
+ }
return;
}
@@ -131,7 +135,9 @@ public class JobSchedulerService extends AbstractScheduledService {
}
}
catch ( Throwable t ) {
- LOG.debug( "Scheduler run failed, error is", t );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Scheduler run failed, error is", t);
+ }
}
}
@@ -192,7 +198,9 @@ public class JobSchedulerService extends AbstractScheduledService {
@Override
public Void call() throws Exception {
- LOG.debug( "Starting the job with job id {}", execution.getJobId() );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Starting the job with job id {}", execution.getJobId());
+ }
runCounter.inc();
execution.start( maxFailCount );
@@ -239,7 +247,9 @@ public class JobSchedulerService extends AbstractScheduledService {
* Release semaphore first in case there are other problems with communicating with Cassandra
*/
- LOG.debug( "Job succeeded with the job id {}", execution.getJobId() );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Job succeeded with the job id {}", execution.getJobId());
+ }
capacitySemaphore.release();
timer.stop();
runCounter.dec();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java b/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
index eedd52e..d69cbb1 100644
--- a/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/batch/service/SchedulerServiceImpl.java
@@ -144,7 +144,9 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
* as discarded
*/
try {
- LOG.debug( "deleteJob {}", jobId );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("deleteJob {}", jobId);
+ }
getEm().delete( new SimpleEntityRef(
Schema.getDefaultSchema().getEntityType(JobData.class), jobId ) );
}
@@ -220,7 +222,9 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
@Override
public void heartbeat( JobRuntime execution, long delay ) {
- LOG.debug( "renew transaction {}", execution.getTransactionId() );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("renew transaction {}", execution.getTransactionId());
+ }
try {
// @TODO - what's the point to this sychronized block on an argument?
synchronized ( execution ) {
@@ -228,7 +232,9 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
new QueueQuery().withTimeout( delay ) );
execution.setTransactionId( newId );
- LOG.debug( "renewed transaction {}", newId );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("renewed transaction {}", newId);
+ }
}
}
catch ( TransactionNotFoundException e ) {
@@ -280,7 +286,9 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
if ( jobStatus == Status.COMPLETED ) {
LOG.info( "Job {} is complete id: {}", data.getJobName(), bulkJobExecution.getTransactionId() );
getQm().deleteTransaction( jobQueueName, bulkJobExecution.getTransactionId(), null );
- LOG.debug( "delete job data {}", data.getUuid() );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("delete job data {}", data.getUuid());
+ }
getEm().delete( data );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
index 016629a..95171a8 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ApplicationIdCacheImpl.java
@@ -85,7 +85,9 @@ public class ApplicationIdCacheImpl implements ApplicationIdCache {
}
return optionalUuid;
} catch (Exception e) {
- logger.debug("Returning for key {} value null", applicationName );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Returning for key {} value null", applicationName);
+ }
return null;
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index cbb06ed..d51131e 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -587,9 +587,11 @@ public class CpEntityManager implements EntityManager {
// // need to reload entity so bypass entity cache
// cpEntity = ecm.load( entityId ).toBlockingObservable().last();
- logger.debug( "Wrote {}:{} version {}", new Object[] {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Wrote {}:{} version {}", new Object[]{
cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
- } );
+ });
+ }
}
catch ( WriteUniqueVerifyException wuve ) {
handleWriteUniqueVerifyException( entity, wuve );
@@ -813,12 +815,18 @@ public class CpEntityManager implements EntityManager {
Inflector.getInstance().singularize( collectionType ), Arrays.<Field>asList( uniqueLookupRepairField ) );
if(fieldSetObservable == null){
- logger.debug( "Couldn't return the observable based on unique entities." );
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Couldn't return the observable based on unique entities.");
+ }
+
return null;
}
+
FieldSet fieldSet = fieldSetObservable.toBlocking().last();
repairedEntityGet.stop();
+
if(fieldSet.isEmpty()) {
return null;
}
@@ -843,7 +851,9 @@ public class CpEntityManager implements EntityManager {
Assert.notNull( collectionType, "collectionType is required" );
Assert.notNull( aliasValue, "aliasValue is required" );
- logger.debug( "getAlias() for collection type {} alias {}", collectionType, aliasValue );
+ if (logger.isDebugEnabled()) {
+ logger.debug("getAlias() for collection type {} alias {}", collectionType, aliasValue);
+ }
String collName = Schema.defaultCollectionName( collectionType );
@@ -878,7 +888,9 @@ public class CpEntityManager implements EntityManager {
public Map<String, EntityRef> getAlias( EntityRef ownerRef, String collName, List<String> aliases )
throws Exception {
- logger.debug( "getAliases() for collection {} aliases {}", collName, aliases );
+ if (logger.isDebugEnabled()) {
+ logger.debug("getAliases() for collection {} aliases {}", collName, aliases);
+ }
Assert.notNull( ownerRef, "ownerRef is required" );
Assert.notNull( collName, "collectionName is required" );
@@ -2141,11 +2153,13 @@ public class CpEntityManager implements EntityManager {
public EntityRef getUserByIdentifier( Identifier identifier ) throws Exception {
if ( identifier == null ) {
+
if(logger.isDebugEnabled()){
logger.debug( "getUserByIdentifier: returning null for null identifier" );
}
return null;
}
+
if(logger.isDebugEnabled()){
logger.debug( "getUserByIdentifier {}:{}", identifier.getType(), identifier.toString() );
}
@@ -2153,10 +2167,12 @@ public class CpEntityManager implements EntityManager {
if ( identifier.isUUID() ) {
return new SimpleEntityRef( "user", identifier.getUUID() );
}
+
if ( identifier.isName() ) {
return this.getAlias( new SimpleEntityRef(
Application.ENTITY_TYPE, applicationId ), "user", identifier.getName() );
}
+
if ( identifier.isEmail() ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index a38324a..5d6f5f8 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -225,8 +225,10 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
applicationId = applicationId==null ? UUIDGenerator.newTimeUUID() : applicationId;
- logger.debug( "New application orgName {} orgAppName {} id {} ",
- new Object[] { orgName, name, applicationId.toString() } );
+ if (logger.isDebugEnabled()) {
+ logger.debug("New application orgName {} orgAppName {} id {} ",
+ new Object[]{orgName, name, applicationId.toString()});
+ }
return initializeApplicationV2( orgName, applicationId, appName, properties );
}
@@ -473,9 +475,10 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
Id managementId = new SimpleId( managementApp.getUuid(), managementApp.getType() );
-
- logger.debug("getApplications(): Loading edges of edgeType {} from {}:{}",
- new Object[]{edgeType, managementId.getType(), managementId.getUuid()});
+ if (logger.isDebugEnabled()) {
+ logger.debug("getApplications(): Loading edges of edgeType {} from {}:{}",
+ new Object[]{edgeType, managementId.getType(), managementId.getUuid()});
+ }
Observable<MarkedEdge> edges = gm.loadEdgesFromSource(
new SimpleSearchByEdgeType( managementId, edgeType, Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING,
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index 67dd3e9..68f22d8 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -178,9 +178,11 @@ public class CpRelationManager implements RelationManager {
String edgeTypePrefix = CpNamingUtils.getEdgeTypeFromCollectionName( collectionName );
- logger.debug( "getCollectionIndexes(): Searching for edge type prefix {} to target {}:{}", new Object[] {
- edgeTypePrefix, cpHeadEntity.getId().getType(), cpHeadEntity.getId().getUuid()
- } );
+ if (logger.isDebugEnabled()) {
+ logger.debug("getCollectionIndexes(): Searching for edge type prefix {} to target {}:{}", new Object[]{
+ edgeTypePrefix, cpHeadEntity.getId().getType(), cpHeadEntity.getId().getUuid()
+ });
+ }
Observable<Set<String>> types =
gm.getEdgeTypesFromSource( new SimpleSearchEdgeType( cpHeadEntity.getId(), edgeTypePrefix, null ) )
@@ -241,7 +243,9 @@ public class CpRelationManager implements RelationManager {
return edges.collect( () -> new LinkedHashMap<EntityRef, Set<String>>(), ( entityRefSetMap, edge ) -> {
if ( fromEntityType != null && !fromEntityType.equals( edge.getSourceNode().getType() ) ) {
- logger.debug( "Ignoring edge from entity type {}", edge.getSourceNode().getType() );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Ignoring edge from entity type {}", edge.getSourceNode().getType());
+ }
return;
}
@@ -260,9 +264,11 @@ public class CpRelationManager implements RelationManager {
Id entityId = new SimpleId( entity.getUuid(), entity.getType() );
- logger.debug( "isConnectionMember(): Checking for edge type {} from {}:{} to {}:{}", new Object[] {
- connectionType, headEntity.getType(), headEntity.getUuid(), entity.getType(), entity.getUuid()
- } );
+ if (logger.isDebugEnabled()) {
+ logger.debug("isConnectionMember(): Checking for edge type {} from {}:{} to {}:{}", new Object[]{
+ connectionType, headEntity.getType(), headEntity.getUuid(), entity.getType(), entity.getUuid()
+ });
+ }
GraphManager gm = managerCache.getGraphManager( applicationScope );
Observable<MarkedEdge> edges = gm.loadEdgeVersions( CpNamingUtils
@@ -279,10 +285,11 @@ public class CpRelationManager implements RelationManager {
Id entityId = new SimpleId( entity.getUuid(), entity.getType() );
-
- logger.debug( "isCollectionMember(): Checking for edge type {} from {}:{} to {}:{}", new Object[] {
- collectionName, headEntity.getType(), headEntity.getUuid(), entity.getType(), entity.getUuid()
- } );
+ if (logger.isDebugEnabled()) {
+ logger.debug("isCollectionMember(): Checking for edge type {} from {}:{} to {}:{}", new Object[]{
+ collectionName, headEntity.getType(), headEntity.getUuid(), entity.getType(), entity.getUuid()
+ });
+ }
GraphManager gm = managerCache.getGraphManager( applicationScope );
Observable<MarkedEdge> edges = gm.loadEdgeVersions( CpNamingUtils
@@ -699,9 +706,11 @@ public class CpRelationManager implements RelationManager {
//load our versions, only retain the most recent one
gm.loadEdgeVersions(searchByEdge).skip(1).flatMap(edgeToDelete -> {
+
if (logger.isDebugEnabled()) {
logger.debug("Marking edge {} for deletion", edgeToDelete);
}
+
return gm.markEdge(edgeToDelete );
}).lastOrDefault(null).doOnNext(lastEdge -> {
//no op if we hit our default
@@ -868,7 +877,11 @@ public class CpRelationManager implements RelationManager {
List<Entity> entities = new ArrayList<Entity>();
for ( EntityRef ref : containers.keySet() ) {
Entity entity = em.get( ref );
- logger.debug( " Found connecting entity: " + entity.getProperties() );
+
+ if (logger.isDebugEnabled()) {
+ logger.debug(" Found connecting entity: " + entity.getProperties());
+ }
+
entities.add( entity );
}
return Results.fromEntities( entities );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
index 722d200..b5b27ac 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpWalker.java
@@ -78,13 +78,15 @@ public class CpWalker {
final GraphManager gm = em.getManagerCache().getGraphManager( applicationScope );
- logger.debug( "Loading edges types from {}:{}\n scope {}:{}",
- new Object[] {
- applicationId.getType(),
- applicationId.getUuid(),
- applicationScope.getApplication().getType(),
- applicationScope.getApplication().getUuid()
- } );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Loading edges types from {}:{}\n scope {}:{}",
+ new Object[]{
+ applicationId.getType(),
+ applicationId.getUuid(),
+ applicationScope.getApplication().getType(),
+ applicationScope.getApplication().getUuid()
+ });
+ }
final SearchByEdgeType.Order order;
if ( reverse ) {
@@ -106,7 +108,9 @@ public class CpWalker {
Observable<Edge> edges = gm.getEdgeTypesFromSource(
new SimpleSearchEdgeType( applicationId, edgeType, null ) ).flatMap( emittedEdgeType -> {
- logger.debug( "Loading edges of type {} from node {}", edgeType, applicationId );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Loading edges of type {} from node {}", edgeType, applicationId);
+ }
return gm.loadEdgesFromSource(
new SimpleSearchByEdgeType( applicationId, emittedEdgeType, Long.MAX_VALUE, order, Optional.absent() ) );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java
index aadb479..3d63ea4 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceFactory.java
@@ -119,7 +119,9 @@ public class GuiceFactory implements FactoryBean<Injector> {
cpProps.put( "collections.keyspace.strategy.options",
getAndValidateProperty( "cassandra.keyspace.replication" ) );
- logger.debug( "Set Cassandra properties for Core Persistence: " + cpProps.toString() );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Set Cassandra properties for Core Persistence: " + cpProps.toString());
+ }
// Make all Usergrid properties into Core Persistence config
cpProps.putAll( systemProperties );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
index 03cb00d..542e54a 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
@@ -286,6 +286,7 @@ public class AmazonAsyncEventService implements AsyncEventService {
* @return
*/
private List<IndexEventResult> callEventHandlers(final List<QueueMessage> messages) {
+
if (logger.isDebugEnabled()) {
logger.debug("callEventHandlers with {} message", messages.size());
}
@@ -305,6 +306,7 @@ public class AmazonAsyncEventService implements AsyncEventService {
}
final AsyncEvent thisEvent = event;
+
if (logger.isDebugEnabled()) {
logger.debug("Processing {} event", event);
}
@@ -464,10 +466,11 @@ public class AmazonAsyncEventService implements AsyncEventService {
final ApplicationScope applicationScope = edgeDeleteEvent.getApplicationScope();
final Edge edge = edgeDeleteEvent.getEdge();
- if (logger.isDebugEnabled()) logger.debug("Deleting in app scope {} with edge {}", applicationScope, edge);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Deleting in app scope {} with edge {}", applicationScope, edge);
+ }
- final Observable<IndexOperationMessage> observable = eventBuilder.buildDeleteEdge(applicationScope, edge);
- return observable;
+ return eventBuilder.buildDeleteEdge(applicationScope, edge);
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
index d624132..813436f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
@@ -76,16 +76,14 @@ public class EventBuilderImpl implements EventBuilder {
@Override
public Observable<IndexOperationMessage> buildEntityIndexUpdate( final ApplicationScope applicationScope,
final Entity entity ) {
-
//process the entity immediately
//only process the same version, otherwise ignore
+ if (log.isDebugEnabled()) {
+ log.debug("Indexing in app scope {} entity {}", entity, applicationScope);
+ }
- log.debug( "Indexing in app scope {} entity {}", entity, applicationScope );
-
- final Observable<IndexOperationMessage> edgeObservable = indexService.indexEntity( applicationScope, entity );
-
- return edgeObservable;
+ return indexService.indexEntity( applicationScope, entity );
}
@@ -93,20 +91,21 @@ public class EventBuilderImpl implements EventBuilder {
public Observable<IndexOperationMessage> buildNewEdge( final ApplicationScope applicationScope, final Entity entity,
final Edge newEdge ) {
- log.debug( "Indexing in app scope {} with entity {} and new edge {}",
- new Object[] { entity, applicationScope, newEdge } );
-
- final Observable<IndexOperationMessage> edgeObservable =
- indexService.indexEdge( applicationScope, entity, newEdge );
+ if (log.isDebugEnabled()) {
+ log.debug("Indexing in app scope {} with entity {} and new edge {}",
+ new Object[]{entity, applicationScope, newEdge});
+ }
- return edgeObservable;
+ return indexService.indexEdge( applicationScope, entity, newEdge );
}
@Override
public Observable<IndexOperationMessage> buildDeleteEdge( final ApplicationScope applicationScope, final Edge
edge ) {
- log.debug( "Deleting in app scope {} with edge {} }", applicationScope, edge );
+ if (log.isDebugEnabled()) {
+ log.debug("Deleting in app scope {} with edge {} }", applicationScope, edge);
+ }
final Observable<IndexOperationMessage> edgeObservable =
indexService.deleteIndexEdge( applicationScope, edge ).flatMap( batch -> {
@@ -123,7 +122,9 @@ public class EventBuilderImpl implements EventBuilder {
@Override
public EntityDeleteResults buildEntityDelete( final ApplicationScope applicationScope, final Id entityId ) {
- log.debug( "Deleting entity id from index in app scope {} with entityId {} }", applicationScope, entityId );
+ if (log.isDebugEnabled()) {
+ log.debug("Deleting entity id from index in app scope {} with entityId {} }", applicationScope, entityId);
+ }
final EntityCollectionManager ecm = entityCollectionManagerFactory.createCollectionManager( applicationScope );
final GraphManager gm = graphManagerFactory.createEdgeManager( applicationScope );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
index 301a7ae..68c398f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
@@ -110,7 +110,9 @@ public class IndexServiceImpl implements IndexService {
.flatMap( buffer -> Observable.from( buffer )
//collect results into a single batch
.collect( () -> ei.createBatch(), ( batch, indexEdge ) -> {
- logger.debug( "adding edge {} to batch for entity {}", indexEdge, entity );
+ if (logger.isDebugEnabled()) {
+ logger.debug("adding edge {} to batch for entity {}", indexEdge, entity);
+ }
batch.index( indexEdge, entity );
} )
//return the future from the batch execution
@@ -138,7 +140,9 @@ public class IndexServiceImpl implements IndexService {
final EntityIndexBatch batch = ei.createBatch();
- logger.debug( "adding edge {} to batch for entity {}", indexEdge, entity );
+ if (logger.isDebugEnabled()) {
+ logger.debug("adding edge {} to batch for entity {}", indexEdge, entity);
+ }
batch.index( indexEdge, entity );
@@ -218,7 +222,9 @@ public class IndexServiceImpl implements IndexService {
final Observable<IndexOperationMessage> batches = Observable.from( crs )
//collect results into a single batch
.collect( () -> ei.createBatch(), ( batch, candidateResult ) -> {
- logger.debug( "Deindexing on edge {} for entity {} added to batch",searchEdge , entityId );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Deindexing on edge {} for entity {} added to batch", searchEdge, entityId);
+ }
batch.deindex( candidateResult );
} )
//return the future from the batch execution
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
index 862a80e..f62fee1 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
@@ -178,7 +178,9 @@ public abstract class AbstractReadGraphFilter extends AbstractPathFilter<Id, Id,
})
//set the edge state for cursors
.doOnNext( edge -> {
- logger.trace( "Seeking over edge {}", edge );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Seeking over edge {}", edge);
+ }
edgeCursorState.update( edge );
} )
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/EntityLoadVerifyFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/EntityLoadVerifyFilter.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/EntityLoadVerifyFilter.java
index c782bce..3f6e26d 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/EntityLoadVerifyFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/EntityLoadVerifyFilter.java
@@ -71,7 +71,9 @@ public class EntityLoadVerifyFilter extends AbstractFilter<FilterResult<Id>, Fil
final Observable<FilterResult<Entity>> entityObservable =
filterResultObservable.buffer( pipelineContext.getLimit() ).flatMap( bufferedIds -> {
- logger.trace( "Attempting to batch load ids {}", bufferedIds );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Attempting to batch load ids {}", bufferedIds);
+ }
final Observable<EntitySet> entitySetObservable =
Observable.from( bufferedIds ).map( filterResultId -> filterResultId.getValue() ).toList()
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/results/ObservableQueryExecutor.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/results/ObservableQueryExecutor.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/results/ObservableQueryExecutor.java
index 7a32dce..007486f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/results/ObservableQueryExecutor.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/results/ObservableQueryExecutor.java
@@ -135,11 +135,16 @@ public abstract class ObservableQueryExecutor<T> implements QueryExecutor {
observable = buildNewResultsPage( cursor ).map( resultsPage -> createResultsInternal( resultsPage ) ).defaultIfEmpty(
new Results() );
- logger.trace( "Trying to load results page" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Trying to load results page");
+ }
+
//take the first from our observable
final Results resultsPage = observable.take(1).toBlocking().first();
- logger.trace( "Results page loaded {}", resultsPage );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Results page loaded {}", resultsPage);
+ }
//set the results for the iterator
this.results = resultsPage;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ConnectionServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ConnectionServiceImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ConnectionServiceImpl.java
index 927d292..4b7e66c 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ConnectionServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ConnectionServiceImpl.java
@@ -158,7 +158,9 @@ public class ConnectionServiceImpl implements ConnectionService {
final GraphManager gm = graphManagerFactory.createEdgeManager( applicationScope );
- logger.debug( "Checking connections of id {} in application {}", entityId, applicationScope );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Checking connections of id {} in application {}", entityId, applicationScope);
+ }
return gm.getEdgeTypesFromSource(
new SimpleSearchEdgeType( entityId, CpNamingUtils.EDGE_CONN_PREFIX, Optional.absent() ) )
@@ -166,7 +168,9 @@ public class ConnectionServiceImpl implements ConnectionService {
//now load all edges from this node of this type
.flatMap( edgeType -> {
- logger.debug( "Found edge of types of {}, searching for edges", edgeType );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Found edge of types of {}, searching for edges", edgeType);
+ }
final SearchByEdgeType searchByEdge =
new SimpleSearchByEdgeType( entityId, edgeType, Long.MAX_VALUE,
@@ -179,7 +183,9 @@ public class ConnectionServiceImpl implements ConnectionService {
//now that we have a stream of edges, stream all versions
.flatMap( edge -> {
- logger.debug( "Found edge {}, searching for multiple versions of edge", edge );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Found edge {}, searching for multiple versions of edge", edge);
+ }
//keep only the most recent
final SearchByEdge searchByEdge =
@@ -191,7 +197,9 @@ public class ConnectionServiceImpl implements ConnectionService {
//mark for deletion
.flatMap( edgeToDelete -> {
- logger.debug( "Deleting edge {}", edgeToDelete );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Deleting edge {}", edgeToDelete);
+ }
//mark the edge and ignore the cleanup result
return gm.markEdge( edgeToDelete );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/count/CassandraCounterStore.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/count/CassandraCounterStore.java b/stack/core/src/main/java/org/apache/usergrid/count/CassandraCounterStore.java
index d505954..036f5d0 100644
--- a/stack/core/src/main/java/org/apache/usergrid/count/CassandraCounterStore.java
+++ b/stack/core/src/main/java/org/apache/usergrid/count/CassandraCounterStore.java
@@ -88,13 +88,10 @@ public class CassandraCounterStore implements CounterStore {
counterInsertFailures.put( error, 1);
} else {
- int count = counterInsertFailures.get(error) + 1;
+ int count = counterInsertFailures.get(error) + 1;
counterInsertFailures.put(error, count);
- if (log.isDebugEnabled()) {
- log.debug( error + " caused CounterStore insert failure, count = " + count, e );
- } else {
- log.error( error + " caused CounterStore insert failure, count = " + count );
- }
+
+ log.error(error + " caused CounterStore insert failure, count = " + count, e);
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/locking/singlenode/SingleNodeLockManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/locking/singlenode/SingleNodeLockManagerImpl.java b/stack/core/src/main/java/org/apache/usergrid/locking/singlenode/SingleNodeLockManagerImpl.java
index bb5b2d9..de33772 100644
--- a/stack/core/src/main/java/org/apache/usergrid/locking/singlenode/SingleNodeLockManagerImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/locking/singlenode/SingleNodeLockManagerImpl.java
@@ -57,7 +57,9 @@ public class SingleNodeLockManagerImpl implements LockManager {
@Override
public void onRemoval( RemovalNotification<String, ReentrantLock> notification ) {
- logger.debug( "Evicting reentrant lock for {}", notification.getKey() );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Evicting reentrant lock for {}", notification.getKey());
+ }
}
} ).build( new CacheLoader<String, ReentrantLock>() {
@@ -75,7 +77,7 @@ public class SingleNodeLockManagerImpl implements LockManager {
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.usergrid.locking.LockManager#createLock(java.util.UUID,
* java.lang.String[])
*/
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueueManagerImpl.java b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueueManagerImpl.java
index ae4e4c9..5ec4971 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueueManagerImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueueManagerImpl.java
@@ -195,7 +195,9 @@ public class QueueManagerImpl implements QueueManager {
final UUID messageUuid = message.getUuid();
- logger.debug( "Adding message with id '{}' to queue '{}'", messageUuid, queueId );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Adding message with id '{}' to queue '{}'", messageUuid, queueId);
+ }
batch.addInsertion( getQueueShardRowKey( queueId, shard_ts ), QUEUE_INBOX.getColumnFamily(),
@@ -209,7 +211,9 @@ public class QueueManagerImpl implements QueueManager {
batch.addInsertion( bytebuffer( queueId ), QUEUE_PROPERTIES.getColumnFamily(),
createColumn( QUEUE_NEWEST, messageUuid, newest_ts, se, ue ) );
- logger.debug( "Writing UUID {} with oldest timestamp {} and newest with timestamp {}", new Object[]{messageUuid, oldest_ts, newest_ts});
+ if (logger.isDebugEnabled()) {
+ logger.debug("Writing UUID {} with oldest timestamp {} and newest with timestamp {}", new Object[]{messageUuid, oldest_ts, newest_ts});
+ }
batch.addInsertion( bytebuffer( getQueueId( "/" ) ), QUEUE_SUBSCRIBERS.getColumnFamily(),
createColumn( queuePath, queueId, timestamp, se, ue ) );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/AbstractSearch.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/AbstractSearch.java b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/AbstractSearch.java
index 0e7dea1..7e5cbc0 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/AbstractSearch.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/AbstractSearch.java
@@ -230,7 +230,9 @@ public abstract class AbstractSearch implements QueueSearch {
results.add( columnName );
- logger.debug( "Added id '{}' to result set for queue id '{}'", start, queueId );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Added id '{}' to result set for queue id '{}'", start, queueId);
+ }
if ( results.size() >= params.limit ) {
return results;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/ConsumerTransaction.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/ConsumerTransaction.java b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/ConsumerTransaction.java
index bdf9afd..17d4934 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/ConsumerTransaction.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/ConsumerTransaction.java
@@ -127,7 +127,9 @@ public class ConsumerTransaction extends NoTransactionSearch
// Generate a new expiration and insert it
UUID expirationId = UUIDUtils.newTimeUUID( now + query.getTimeout() );
- logger.debug( "Writing new timeout at '{}' for message '{}'", expirationId, messageId );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Writing new timeout at '{}' for message '{}'", expirationId, messageId);
+ }
Mutator<ByteBuffer> mutator = CountingMutator.createFlushingMutator( ko, be );
@@ -300,7 +302,9 @@ public class ConsumerTransaction extends NoTransactionSearch
}
catch ( UGLockException e )
{
- logger.debug( "Unable to acquire lock", e );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Unable to acquire lock", e);
+ }
throw new QueueException( "Unable to acquire lock", e );
}
finally
@@ -311,7 +315,9 @@ public class ConsumerTransaction extends NoTransactionSearch
}
catch ( UGLockException e )
{
- logger.debug( "Unable to release lock", e );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Unable to release lock", e);
+ }
throw new QueueException( "Unable to release lock", e );
}
}
@@ -439,7 +445,9 @@ public class ConsumerTransaction extends NoTransactionSearch
UUID expirationId = UUIDUtils.newTimeUUID( futureTimeout, counter );
UUID messageId = message.getUuid();
- logger.debug( "Writing new timeout at '{}' for message '{}'", expirationId, messageId );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Writing new timeout at '{}' for message '{}'", expirationId, messageId);
+ }
mutator.addInsertion( key, CONSUMER_QUEUE_TIMEOUTS.getColumnFamily(),
createColumn( expirationId, messageId, time, ue, ue ) );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/persistence/Schema.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/Schema.java b/stack/core/src/main/java/org/apache/usergrid/persistence/Schema.java
index d1ac6dc..197082b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/Schema.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/Schema.java
@@ -1583,8 +1583,13 @@ public class Schema implements SchemaManager {
}
String entityType = string( columns.get( PROPERTY_TYPE ) );
+
if ( entityType == null ) {
- logger.debug( "deserializeEntityProperties(): No type for entity found, entity probably doesn't exist" );
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("deserializeEntityProperties(): No type for entity found, entity probably doesn't exist");
+ }
+
return null;
}
if ( checkId && !columns.containsKey( PROPERTY_UUID ) ) {
@@ -1594,8 +1599,11 @@ public class Schema implements SchemaManager {
if ( checkRequired ) {
Set<String> required_properties = Schema.getDefaultSchema().getRequiredProperties( entityType );
+
if ( required_properties != null ) {
+
for ( String property_name : required_properties ) {
+
if ( !columns.containsKey( property_name ) ) {
logger.error( "Entity (" + entityType + ") missing required property: " + property_name,
new Throwable() );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
index bbf844b..c94bf59 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
@@ -224,7 +224,11 @@ public class CassandraPersistenceUtils {
return NULL_ID;
}
UUID uuid = UUID.nameUUIDFromBytes( keyStr.getBytes() ); //UUIDUtils.newTimeUUID(); //UUID.nameUUIDFromBytes( keyStr.getBytes() );
- logger.debug( "Key {} equals UUID {}", keyStr, uuid );
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Key {} equals UUID {}", keyStr, uuid);
+ }
+
return uuid;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java
index a08c543..e973764 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraService.java
@@ -486,10 +486,14 @@ public class CassandraService {
if ( db_logger.isDebugEnabled() ) {
if ( results == null ) {
- db_logger.debug( "getColumns returned null" );
+ if (logger.isDebugEnabled()) {
+ db_logger.debug("getColumns returned null");
+ }
}
else {
- db_logger.debug( "getColumns returned " + results.size() + " columns" );
+ if (logger.isDebugEnabled()) {
+ db_logger.debug("getColumns returned " + results.size() + " columns");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CounterUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CounterUtils.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CounterUtils.java
index 88603ac..032836f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CounterUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CounterUtils.java
@@ -224,10 +224,16 @@ public class CounterUtils {
UUID queueId, String category, String name, long value,
long counterTimestamp, long cassandraTimestamp ) {
for ( CounterResolution resolution : CounterResolution.values() ) {
- logger.debug( "BIAC for resolution {}", resolution );
+ if (logger.isDebugEnabled()) {
+ logger.debug("BIAC for resolution {}", resolution);
+ }
+
batchIncrementAggregateCounters( m, userId, groupId, queueId, category, resolution, name, value,
counterTimestamp, applicationId );
- logger.debug( "DONE BIAC for resolution {}", resolution );
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("DONE BIAC for resolution {}", resolution);
+ }
}
batchIncrementEntityCounter( m, applicationId, name, value, cassandraTimestamp, applicationId );
if ( userId != null ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagAspect.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagAspect.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagAspect.java
index bc8ff76..5825ee0 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagAspect.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagAspect.java
@@ -38,7 +38,11 @@ public class TraceTagAspect {
public Object applyTrace( ProceedingJoinPoint pjp ) throws Throwable {
String tagName = pjp.toLongString();
- logger.debug( "Applyng trace on {}", tagName );
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Applyng trace on {}", tagName);
+ }
+
TimedOpTag timedOpTag = traceTagManager.timerInstance();
boolean success = true;
try {
@@ -51,7 +55,10 @@ public class TraceTagAspect {
finally {
timedOpTag.stopAndApply( tagName, success );
traceTagManager.addTimer( timedOpTag );
- logger.debug( "TimedOpTag added in Aspect on {}", tagName );
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("TimedOpTag added in Aspect on {}", tagName);
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagManager.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagManager.java
index 775cbd3..67eb7ec 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/TraceTagManager.java
@@ -146,7 +146,9 @@ public class TraceTagManager {
public void attach( TraceTag traceTag ) {
Preconditions.checkState( !isActive(), "Attempt to attach on already active trace" );
localTraceTag.set( traceTag );
- logger.debug( "Attached TraceTag {} to thread", traceTag );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Attached TraceTag {} to thread", traceTag);
+ }
}
@@ -155,7 +157,9 @@ public class TraceTagManager {
TraceTag traceTag = localTraceTag.get();
Preconditions.checkState( isActive(), "Attempt to detach on no active trace" );
localTraceTag.remove();
- logger.debug( "Detached TraceTag {} from thread", traceTag );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Detached TraceTag {} from thread", traceTag);
+ }
return traceTag;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
index e7dcaec..4f1b54e 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
@@ -72,7 +72,9 @@ public class JsonUtils {
return mapper.writeValueAsString( obj );
}
catch ( Throwable t ) {
- LOG.debug( "Error generating JSON", t );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Error generating JSON", t);
+ }
throw new JsonWriteException( "Error generating JSON", t );
}
}
@@ -84,7 +86,9 @@ public class JsonUtils {
return indentObjectMapper.writeValueAsString( obj );
}
catch ( Throwable t ) {
- LOG.debug( "Error generating JSON", t );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Error generating JSON", t);
+ }
throw new JsonWriteException( "Error generating JSON", t );
}
}
@@ -96,7 +100,9 @@ public class JsonUtils {
return mapper.readValue( json, Object.class );
}
catch ( Throwable t ) {
- LOG.debug( "Error parsing JSON", t );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Error parsing JSON", t);
+ }
throw new JsonReadException( "Error parsing JSON", t );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListener.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListener.java b/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListener.java
index f212311..03ee591 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListener.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListener.java
@@ -67,19 +67,25 @@ public class TestJobListener implements JobListener {
public void onSubmit( JobExecution execution ) {
- LOG.debug( "Job execution {} submitted with count {}.", execution, submittedCounter.incrementAndGet() );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Job execution {} submitted with count {}.", execution, submittedCounter.incrementAndGet());
+ }
}
public void onSuccess( JobExecution execution ) {
- LOG.debug( "Job execution {} succeeded with count {}.", execution, successCounter.incrementAndGet() );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Job execution {} succeeded with count {}.", execution, successCounter.incrementAndGet());
+ }
latch.countDown();
}
public void onFailure( JobExecution execution ) {
- LOG.debug( "Job execution {} failed with count {}.", execution, failureCounter.incrementAndGet() );
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Job execution {} failed with count {}.", execution, failureCounter.incrementAndGet());
+ }
latch.countDown();
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/test/java/org/apache/usergrid/persistence/RebuildIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/RebuildIndexTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/RebuildIndexTest.java
index 7d80644..5f623cd 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/RebuildIndexTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/RebuildIndexTest.java
@@ -64,7 +64,9 @@ public class RebuildIndexTest extends AbstractCoreIT {
@Before
public void startReporting() {
- logger.debug( "Starting metrics reporting" );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Starting metrics reporting");
+ }
}
@@ -457,12 +459,12 @@ public class RebuildIndexTest extends AbstractCoreIT {
// ----------------- test that we can read them, should fail
- logger.debug( "Reading data, should fail this time " );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Reading data, should fail this time ");
+ }
countEntities( em, collectionName, 0);
-
-
// ----------------- rebuild index
final long firstUpdatedTimestamp = firstEntity.getModified();
@@ -472,12 +474,11 @@ public class RebuildIndexTest extends AbstractCoreIT {
try {
-
-
final long updatedTimestamp = secondEntity.getModified();
-
- logger.debug( "Preparing to rebuild all indexes with timestamp {}", updatedTimestamp );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Preparing to rebuild all indexes with timestamp {}", updatedTimestamp);
+ }
//set our update timestamp
final ReIndexRequestBuilder builder =
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java
index f520482..9ab8c78 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java
@@ -129,7 +129,9 @@ public class IntersectionUnionPagingIT {
Entity saved = io.writeEntity( entity );
- LOG.debug("Writing entity with id '{}'", saved.getUuid());
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Writing entity with id '{}'", saved.getUuid());
+ }
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
index 23661ee..8c12a25 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
@@ -222,7 +222,7 @@ public class MultiKeyColumnNameIterator<C, T> implements Iterable<T>, Iterator<T
//may block if we get full, that's expected behavior
try {
- LOG.trace( "Received element {}" , t );
+ if (LOG.isTraceEnabled()) LOG.trace( "Received element {}" , t );
queue.put( t );
}
catch ( InterruptedException e ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
index c6c1a12..a120fda 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
@@ -149,7 +149,7 @@ public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
public void advance() {
- logger.trace( "Advancing multi row column iterator" );
+ if (logger.isTraceEnabled()) logger.trace( "Advancing multi row column iterator" );
/**
* If the edge is present, we need to being seeking from this
@@ -176,7 +176,7 @@ public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
rangeBuilder.setLimit( selectSize );
- logger.trace( "Executing cassandra query" );
+ if (logger.isTraceEnabled()) logger.trace( "Executing cassandra query" );
/**
* Get our list of slices
@@ -245,7 +245,7 @@ public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
currentColumnIterator = mergedResults.iterator();
- logger.trace( "Finished parsing {} rows for results", rowKeys.size() );
+ if (logger.isTraceEnabled()) logger.trace( "Finished parsing {} rows for results", rowKeys.size() );
}
@@ -278,7 +278,7 @@ public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
*/
private List<T> singleRowResult( final Rows<R, C> result ) {
- logger.trace( "Only a single row has columns. Parsing directly" );
+ if (logger.isTraceEnabled()) logger.trace( "Only a single row has columns. Parsing directly" );
for ( R key : result.getKeys() ) {
final ColumnList<C> columnList = result.getRow( key ).getColumns();
@@ -311,7 +311,7 @@ public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
*/
private List<T> mergeResults( final Rows<R, C> result, final int maxSize ) {
- logger.trace( "Multiple rows have columns. Merging" );
+ if (logger.isTraceEnabled()) logger.trace( "Multiple rows have columns. Merging" );
final List<T> mergedResults = new ArrayList<>(maxSize);
@@ -360,7 +360,7 @@ public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
continue;
}
- logger.trace( "Adding value {} to merged set at index {}", returnedValue, insertIndex );
+ if (logger.isTraceEnabled()) logger.trace( "Adding value {} to merged set at index {}", returnedValue, insertIndex );
mergedResults.add( insertIndex, returnedValue );
@@ -368,14 +368,14 @@ public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
//prune the mergedResults
while ( mergedResults.size() > maxSize ) {
- logger.trace( "Trimming results to size {}", maxSize );
+ if (logger.isTraceEnabled()) logger.trace( "Trimming results to size {}", maxSize );
//just remove from our tail until the size falls to the correct value
mergedResults.remove(mergedResults.size()-1);
}
}
- logger.trace( "Candidate result set size is {}", mergedResults.size() );
+ if (logger.isTraceEnabled()) logger.trace( "Candidate result set size is {}", mergedResults.size() );
}
return mergedResults;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java
index 57409e1..81cc973 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java
@@ -66,7 +66,7 @@ public abstract class ObservableIterator<T> implements Observable.OnSubscribe<T>
while ( itr.hasNext() && !subscriber.isUnsubscribed() ) {
final T next = itr.next();
- log.trace( "Iterator '{}' emitting item '{}'", name, next );
+ if (log.isTraceEnabled()) log.trace( "Iterator '{}' emitting item '{}'", name, next );
subscriber.onNext( next );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java
index 6600b3e..c78f3e8 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java
@@ -149,7 +149,7 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
//we're done, just drain the queue since there are no more running producers
if ( completed == innerSubscribers.size() ) {
- log.trace( "Completing Observable. Draining elements from the subscribers", innerSubscribers.size() );
+ if (log.isTraceEnabled()) log.trace( "Completing Observable. Draining elements from the subscribers", innerSubscribers.size() );
//Drain the queues
while ( !subscriber.isUnsubscribed() && (!nextValues.isEmpty() || !toProduce.isEmpty()) ) {
@@ -225,7 +225,7 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
final T value = inner.pop();
- log.trace( "Emitting value {}", value );
+ if (log.isTraceEnabled()) log.trace( "Emitting value {}", value );
subscriber.onNext( value );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/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 62274ec..8fa8914 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,13 +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 );
+ if (LOG.isTraceEnabled()) 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 );
+ if (LOG.isTraceEnabled()) LOG.trace( "Shard entry group {} does not have 1 entry, not allocating", shardEntryGroup );
return false;
}
@@ -158,7 +158,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
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 );
+ if (LOG.isTraceEnabled()) 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;
}
@@ -199,7 +199,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
if ( !edges.hasNext() ) {
- LOG.trace(
+ if (LOG.isTraceEnabled()) LOG.trace(
"Tried to allocate a new shard for edge meta data {}, " + "but no max value could be found in that row",
directedEdgeMeta );
return false;
@@ -231,7 +231,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
* Sanity check in case we audit before we have a full shard
*/
if ( marked == null ) {
- LOG.trace( "Shard {} in shard group {} not full, not splitting", shard, shardEntryGroup );
+ if (LOG.isTraceEnabled()) LOG.trace( "Shard {} in shard group {} not full, not splitting", shard, shardEntryGroup );
return false;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupColumnIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupColumnIterator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupColumnIterator.java
index 9604e63..2597681 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupColumnIterator.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupColumnIterator.java
@@ -122,13 +122,13 @@ public abstract class ShardGroupColumnIterator implements Iterator<MarkedEdge> {
public boolean advance() {
- logger.trace( "Advancing from shard entry group iterator" );
+ if (logger.isTraceEnabled()) logger.trace( "Advancing from shard entry group iterator" );
while ( entryGroupIterator.hasNext() ) {
final ShardEntryGroup group = entryGroupIterator.next();
- logger.trace( "Shard entry group is {}. Searching for edges in the shard", group );
+ if (logger.isTraceEnabled()) logger.trace( "Shard entry group is {}. Searching for edges in the shard", group );
elements = getIterator( group.getReadShards() );
@@ -136,11 +136,11 @@ public abstract class ShardGroupColumnIterator implements Iterator<MarkedEdge> {
* We're done, we have some columns to return
*/
if ( elements.hasNext() ) {
- logger.trace( "Found edges in shard entry group {}", group );
+ if (logger.isTraceEnabled()) logger.trace( "Found edges in shard entry group {}", group );
return true;
}
else {
- logger.trace( "Our shard is empty, we need to perform an audit on shard group {}", group );
+ if (logger.isTraceEnabled()) logger.trace( "Our shard is empty, we need to perform an audit on shard group {}", group );
//fire and forget if we miss it here, we'll get it next read
shardGroupDeletion.maybeDeleteShard(this.applicationScope, this.directedEdgeMeta, group, getIteratorFullRange( group.getReadShards() ) );
@@ -149,7 +149,7 @@ public abstract class ShardGroupColumnIterator implements Iterator<MarkedEdge> {
}
}
- logger.trace( "Completed iterating shard group iterator" );
+ if (logger.isTraceEnabled()) logger.trace( "Completed iterating shard group iterator" );
return false;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
index 373d42b..6a86385 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
@@ -103,7 +103,7 @@ public class ShardGroupDeletionImpl implements ShardGroupDeletion {
Futures.addCallback( future, new FutureCallback<DeleteResult>() {
@Override
public void onSuccess( @Nullable final ShardGroupDeletion.DeleteResult result ) {
- logger.trace( "Successfully completed delete of task {}", result );
+ if (logger.isTraceEnabled()) logger.trace( "Successfully completed delete of task {}", result );
}
@@ -128,38 +128,44 @@ public class ShardGroupDeletionImpl implements ShardGroupDeletion {
//Use ths to TEMPORARILY remove deletes from occurring
//return DeleteResult.NO_OP;
- logger.trace( "Beginning audit of shard group {}", shardEntryGroup );
+ if (logger.isTraceEnabled()) logger.trace( "Beginning audit of shard group {}", shardEntryGroup );
/**
* Compaction is pending, we cannot check it
*/
if ( shardEntryGroup.isCompactionPending() ) {
- logger.trace( "Shard group {} is compacting, not auditing group", shardEntryGroup );
+ if (logger.isTraceEnabled()) logger.trace( "Shard group {} is compacting, not auditing group", shardEntryGroup );
return DeleteResult.COMPACTION_PENDING;
}
- logger.trace( "Shard group {} has no compaction pending", shardEntryGroup );
+ if (logger.isTraceEnabled()) logger.trace( "Shard group {} has no compaction pending", shardEntryGroup );
final long currentTime = timeService.getCurrentTime();
if ( shardEntryGroup.isNew( currentTime ) ) {
- logger.trace( "Shard group {} contains a shard that is is too new, not auditing group", shardEntryGroup );
+ if (logger.isTraceEnabled()) logger.trace( "Shard group {} contains a shard that is is too new, not auditing group", shardEntryGroup );
return DeleteResult.TOO_NEW;
}
- logger.trace( "Shard group {} has passed the delta timeout at {}", shardEntryGroup, currentTime );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Shard group {} has passed the delta timeout at {}", shardEntryGroup, currentTime);
+ }
/**
* We have edges, and therefore cannot delete them
*/
if ( edgeIterator.hasNext() ) {
- logger.trace( "Shard group {} has edges, not deleting", shardEntryGroup );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Shard group {} has edges, not deleting", shardEntryGroup);
+ }
return DeleteResult.CONTAINS_EDGES;
}
- logger.trace( "Shard group {} has no edges continuing to delete", shardEntryGroup, currentTime );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Shard group {} has no edges continuing to delete", shardEntryGroup, currentTime);
+ }
//now we can proceed based on the shard meta state and we don't have any edge
@@ -172,7 +178,9 @@ public class ShardGroupDeletionImpl implements ShardGroupDeletion {
//skip the min shard
if(shard.isMinShard()){
- logger.trace( "Shard {} in group {} is the minimum, not deleting", shard, shardEntryGroup );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Shard {} in group {} is the minimum, not deleting", shard, shardEntryGroup);
+ }
continue;
}
@@ -212,7 +220,9 @@ public class ShardGroupDeletionImpl implements ShardGroupDeletion {
}
}
- logger.trace( "Completed auditing shard group {}", shardEntryGroup );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Completed auditing shard group {}", shardEntryGroup);
+ }
return result;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/af9d81e0/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java
index 4411c25..9e84491 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java
@@ -93,7 +93,9 @@ public class ShardsColumnIterator<R, C, T> implements Iterator<T> {
*/
private void startIterator() {
- logger.trace( "Starting shards column iterator" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Starting shards column iterator");
+ }
/**
@@ -113,7 +115,9 @@ public class ShardsColumnIterator<R, C, T> implements Iterator<T> {
*/
final List<ScopedRowKey<R>> rowKeys = searcher.getRowKeys();
- logger.trace( "Searching with row keys {}", rowKeys );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Searching with row keys {}", rowKeys);
+ }
currentColumnIterator = new MultiRowColumnIterator<>( keyspace, cf, consistencyLevel, searcher, searcher, searcher.getComparator(), rowKeys, pageSize);