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/02/02 17:42:38 UTC
[1/7] usergrid git commit: USERGRID-1243: logging overhaul, pt. 1
Repository: usergrid
Updated Branches:
refs/heads/master 4aac68ece -> 47a86701e
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UserResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UserResource.java
index 77ba756..1971d22 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UserResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UserResource.java
@@ -134,7 +134,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "UserResource.setUserPassword" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.setUserPassword");
+ }
if ( json == null ) {
return null;
@@ -177,7 +179,9 @@ public class UserResource extends ServiceResource {
public ApiResponse getUserCredentials(@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "UserResource.getUserCredentials" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.getUserCredentials");
+ }
final ApiResponse response = createApiResponse();
@@ -214,7 +218,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "UserResource.setUserCredentials" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.setUserCredentials");
+ }
if ( json == null ) {
return null;
@@ -284,7 +290,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "UserResource.sendPin" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.sendPin");
+ }
ApiResponse response = createApiResponse();
response.setAction( "retrieve user pin" );
@@ -320,7 +328,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "UserResource.setPin" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.setPin");
+ }
ApiResponse response = createApiResponse();
response.setAction( "set user pin" );
@@ -346,7 +356,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "UserResource.postPin" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.postPin");
+ }
ApiResponse response = createApiResponse();
response.setAction( "set user pin" );
@@ -372,7 +384,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "UserResource.jsonPin" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.jsonPin");
+ }
ApiResponse response = createApiResponse();
response.setAction( "set user pin" );
@@ -393,7 +407,9 @@ public class UserResource extends ServiceResource {
@Produces(MediaType.TEXT_HTML)
public Viewable showPasswordResetForm( @Context UriInfo ui, @QueryParam("token") String token ) {
- logger.info( "UserResource.showPasswordResetForm" );
+ if (logger.isTraceEnabled()) {
+ logger.trace( "UserResource.showPasswordResetForm" );
+ }
this.token = token;
try {
@@ -424,7 +440,9 @@ public class UserResource extends ServiceResource {
@FormParam("recaptcha_response_field") String uresponse ) {
try {
- logger.info( "UserResource.handlePasswordResetForm" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.handlePasswordResetForm");
+ }
this.token = token;
@@ -562,7 +580,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "Send activation email for user: {}", getUserUuid() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Send activation email for user: {}", getUserUuid());
+ }
ApiResponse response = createApiResponse();
@@ -581,7 +601,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "Revoking user tokens for {}" , getUserUuid() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Revoking user tokens for {}", getUserUuid());
+ }
ApiResponse response = createApiResponse();
@@ -611,7 +633,9 @@ public class UserResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback,
@QueryParam("token") String token ) throws Exception {
- logger.info( "Revoking user token for {}", getUserUuid() );
+ if (logger.isTraceEnabled()) {
+ logger.trace( "Revoking user token for {}", getUserUuid() );
+ }
ApiResponse response = createApiResponse();
@@ -639,8 +663,8 @@ public class UserResource extends ServiceResource {
public Response getAccessToken( @Context UriInfo ui, @QueryParam("ttl") long ttl,
@QueryParam("callback") @DefaultValue("") String callback ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("UserResource.getAccessToken");
+ if (logger.isTraceEnabled()) {
+ logger.trace("UserResource.getAccessToken");
}
try {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UsersResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UsersResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UsersResource.java
index 81cf59a..b8b1300 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UsersResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UsersResource.java
@@ -71,8 +71,8 @@ public class UsersResource extends ServiceResource {
public AbstractContextResource addIdParameter( @Context UriInfo ui, @PathParam("entityId") PathSegment entityId )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.addIdParameter" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.addIdParameter" );
}
UUID itemId = UUID.fromString( entityId.getPath() );
@@ -90,9 +90,9 @@ public class UsersResource extends ServiceResource {
public AbstractContextResource addNameParameter( @Context UriInfo ui, @PathParam("itemName") PathSegment itemName )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.addNameParameter" );
- logger.debug( "Current segment is " + itemName.getPath() );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.addNameParameter" );
+ logger.trace( "Current segment is {}", itemName.getPath() );
}
if ( itemName.getPath().startsWith( "{" ) ) {
@@ -212,8 +212,8 @@ public class UsersResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "UsersResource.executePost: body = " + body);
+ if(logger.isTraceEnabled()){
+ logger.trace( "UsersResource.executePost: body = {}", body);
}
Object json = readJsonToObject( body );
@@ -226,8 +226,8 @@ public class UsersResource extends ServiceResource {
boolean activated = !( ( confRequred != null ) && confRequred );
- if(logger.isDebugEnabled()){
- logger.debug("Confirmation required: {} Activated: {}", confRequred, activated );
+ if(logger.isTraceEnabled()){
+ logger.trace("Confirmation required: {} Activated: {}", confRequred, activated );
}
if ( json instanceof Map ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
index b4fad57..19d35fd 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
@@ -71,11 +71,11 @@ public abstract class AbstractExceptionMapper<E extends java.lang.Throwable> imp
if ( status >= 500 ) {
// only log real errors as errors
- logger.error( e.getClass().getCanonicalName() + " 5XX Uncaught Exception (" + status + ")", e );
+ logger.error( "{} 5XX Uncaught Exception ({})", e.getClass().getCanonicalName(), status, e );
} else {
if (logger.isDebugEnabled()) {
- logger.debug(e.getClass().getCanonicalName() + " Following Exception Thrown (" + status + ")", e);
+ logger.debug( "{} Following Exception Thrown ({})", e.getClass().getCanonicalName(), status, e );
}
}
@@ -105,9 +105,9 @@ public abstract class AbstractExceptionMapper<E extends java.lang.Throwable> imp
private Response toResponse( int status, String jsonResponse ) {
if ( status >= 500 ) {
// only log real errors as errors
- logger.error( "Server Error (" + status + "):\n" + jsonResponse );
+ logger.error( "Server Error ({}):\n{}", status, jsonResponse );
} else if ( logger.isDebugEnabled() ) {
- logger.debug( "Client Error (" + status + "):\n" + jsonResponse );
+ logger.debug( "Client Error ({}):\n{}", status, jsonResponse );
}
String callback = httpServletRequest.getParameter( "callback" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/NotAllowedExceptionMapper.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/NotAllowedExceptionMapper.java b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/NotAllowedExceptionMapper.java
index a65276f..0ffd5b9 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/NotAllowedExceptionMapper.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/NotAllowedExceptionMapper.java
@@ -24,9 +24,6 @@ import javax.ws.rs.ext.Provider;
import static javax.ws.rs.core.Response.Status.METHOD_NOT_ALLOWED;
-/**
- * Created by ApigeeCorporation on 1/8/16.
- */
@Provider
public class NotAllowedExceptionMapper extends AbstractExceptionMapper<NotAllowedException> {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java
index b7aae50..90629ef 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/ContentTypeFilter.java
@@ -64,7 +64,9 @@ public class ContentTypeFilter implements Filter {
*/
@Override
public void init( FilterConfig filterConfig ) throws ServletException {
- logger.info( "Starting content type filter" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Starting content type filter");
+ }
}
@@ -135,8 +137,8 @@ public class ContentTypeFilter implements Filter {
String path = origRequest.getRequestURI();
String method = origRequest.getMethod();
- if (logger.isDebugEnabled()) {
- logger.debug("Content path is '{}'", path);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Content path is '{}'", path);
}
@@ -155,9 +157,8 @@ public class ContentTypeFilter implements Filter {
// request has no body, set type to application/json
if ( ( HttpMethod.POST.equals( method ) || HttpMethod.PUT.equals( method ) )
&& !MediaType.APPLICATION_FORM_URLENCODED.equals( getContentType() ) ) {
- if (logger.isDebugEnabled()) {
- logger.debug("Setting content type to application/json " +
- "for POST or PUT with no content at path '{}'", path);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Setting content type to application/json for POST or PUT with no content at path '{}'", path);
}
setHeader( HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON );
@@ -172,9 +173,8 @@ public class ContentTypeFilter implements Filter {
&& !MediaType.APPLICATION_JSON.equals( getContentType() )) {
// request appears to be JSON so set type to application/json
- if (logger.isDebugEnabled()) {
- logger.debug("Setting content type to application/json " +
- "for POST or PUT with json content at path '{}'", path);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Setting content type to application/json for POST or PUT with json content at path '{}'", path);
}
setHeader( HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON );
setHeader( HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/filters/JSONPCallbackFilter.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/filters/JSONPCallbackFilter.java b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/JSONPCallbackFilter.java
index 23ccdf9..cc1a943 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/filters/JSONPCallbackFilter.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/JSONPCallbackFilter.java
@@ -44,7 +44,9 @@ public class JSONPCallbackFilter implements ContainerRequestFilter {
public JSONPCallbackFilter() {
- logger.info( "JSONPCallbackFilter is installed" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("JSONPCallbackFilter is installed");
+ }
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
index 11fd897..6088bf2 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
@@ -130,7 +130,9 @@ public class ManagementResource extends AbstractContextResource {
public ManagementResource() {
- logger.info( "ManagementResource initialized" );
+ if (logger.isTraceEnabled()) {
+ logger.trace( "ManagementResource initialized" );
+ }
}
@@ -221,7 +223,9 @@ public class ManagementResource extends AbstractContextResource {
user = SubjectUtils.getUser();
}
- logger.info( "ManagementResource.getAccessToken with username: {}", username );
+ if (logger.isTraceEnabled()) {
+ logger.trace("ManagementResource.getAccessToken with username: {}", username);
+ }
String errorDescription = "invalid username or password";
@@ -255,7 +259,9 @@ public class ManagementResource extends AbstractContextResource {
user = management.verifyAdminUserPasswordCredentials( username, password );
if ( user != null ) {
- logger.info( "found user from verify: {}", user.getUuid() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("found user from verify: {}", user.getUuid());
+ }
}
}
catch ( UnactivatedAdminUserException uaue ) {
@@ -268,7 +274,7 @@ public class ManagementResource extends AbstractContextResource {
}
catch ( UnconfirmedAdminUserException uaue ) {
errorDescription = "User must be confirmed to authenticate";
- logger.warn( "Responding with HTTP 403 forbidden response for unconfirmed user {}" , user);
+ logger.warn( "Responding with HTTP 403 forbidden response for unconfirmed user");
OAuthResponse response = OAuthResponse.errorResponse( SC_FORBIDDEN )
.setError( OAuthError.TokenResponse.INVALID_GRANT )
@@ -343,7 +349,9 @@ public class ManagementResource extends AbstractContextResource {
@QueryParam( "callback" ) @DefaultValue( "" ) String callback )
throws Exception {
- logger.info( "ManagementResource.getAccessTokenPost" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("ManagementResource.getAccessTokenPost");
+ }
return getAccessTokenInternal( ui, authorization, grant_type, username, password, client_id, client_secret, ttl,
callback, false, false);
@@ -453,8 +461,8 @@ public class ManagementResource extends AbstractContextResource {
@FormParam( "username" ) String username,
@FormParam( "password" ) String password ) {
- if (logger.isDebugEnabled()) {
- logger.debug("ManagementResource /authorize: {}/{}", username, password);
+ if (logger.isTraceEnabled()) {
+ logger.trace("ManagementResource /authorize: {}", username);
}
try {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationResource.java
index f777637..ddca21a 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationResource.java
@@ -73,16 +73,16 @@ public class OrganizationResource extends AbstractContextResource {
public OrganizationResource() {
- if (logger.isDebugEnabled()) {
- logger.debug("OrganizationResource created");
+ if (logger.isTraceEnabled()) {
+ logger.trace("OrganizationResource created");
}
}
public OrganizationResource init( OrganizationInfo organization ) {
this.organization = organization;
- if (logger.isDebugEnabled()) {
- logger.debug("OrganizationResource initialized for org {}", organization.getName());
+ if (logger.isTraceEnabled()) {
+ logger.trace("OrganizationResource initialized for org {}", organization.getName());
}
return this;
}
@@ -114,7 +114,9 @@ public class OrganizationResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "Get details for organization: " + organization.getUuid() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Get details for organization: {}", organization.getUuid());
+ }
ApiResponse response = createApiResponse();
response.setProperty( "organization", management.getOrganizationData( organization ) );
@@ -176,7 +178,7 @@ public class OrganizationResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "Send activation email for organization: " + organization.getUuid() );
+ logger.info("Send activation email for organization: {}", organization.getUuid());
ApiResponse response = createApiResponse();
@@ -263,8 +265,8 @@ public class OrganizationResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("executePut");
+ if (logger.isTraceEnabled()) {
+ logger.trace("executePut");
}
ApiResponse response = createApiResponse();
@@ -287,8 +289,8 @@ public class OrganizationResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("") String callback )
throws OAuthSystemException {
- if (logger.isDebugEnabled()) {
- logger.debug("executePostJson");
+ if (logger.isTraceEnabled()) {
+ logger.trace("executePostJson");
}
Map<String, String> uuidRet = new HashMap<>();
@@ -404,7 +406,9 @@ public class OrganizationResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "Get configuration for organization: " + organization.getUuid() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Get configuration for organization: {}", organization.getUuid());
+ }
ApiResponse response = createApiResponse();
response.setAction( "get organization configuration" );
@@ -436,8 +440,8 @@ public class OrganizationResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("Put configuration for organization: " + organization.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Put configuration for organization: {}", organization.getUuid());
}
ApiResponse response = createApiResponse();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
index ee35cb1..0348c01 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationsResource.java
@@ -135,8 +135,8 @@ public class OrganizationsResource extends AbstractContextResource {
@QueryParam( "callback" ) @DefaultValue( "" ) String callback )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("newOrganization");
+ if (logger.isTraceEnabled()) {
+ logger.trace("newOrganization");
}
ApiResponse response = createApiResponse();
@@ -174,8 +174,8 @@ public class OrganizationsResource extends AbstractContextResource {
@QueryParam( "callback" ) @DefaultValue( "" ) String callback )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("New organization: {}", organizationNameForm);
+ if (logger.isTraceEnabled()) {
+ logger.trace("New organization: {}", organizationNameForm);
}
String organizationName = organizationNameForm != null ? organizationNameForm : organizationNameQuery;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
index dea6705..fd137a0 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
@@ -503,8 +503,8 @@ public class ApplicationResource extends AbstractContextResource {
management.deleteApplication( applicationId );
- if (logger.isDebugEnabled()) {
- logger.debug("ApplicationResource.delete() deleted appId = {}", applicationId);
+ if (logger.isTraceEnabled()) {
+ logger.trace("ApplicationResource.delete() deleted appId = {}", applicationId);
}
ApiResponse response = createApiResponse();
@@ -512,8 +512,8 @@ public class ApplicationResource extends AbstractContextResource {
response.setApplication(emf.getEntityManager( applicationId ).getApplication());
response.setParams(ui.getQueryParameters());
- if (logger.isDebugEnabled()) {
- logger.debug("ApplicationResource.delete() sending response ");
+ if (logger.isTraceEnabled()) {
+ logger.trace("ApplicationResource.delete() sending response ");
}
return response;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationsResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationsResource.java
index c359e30..1b999ec 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationsResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationsResource.java
@@ -111,8 +111,8 @@ public class ApplicationsResource extends AbstractContextResource {
@FormParam( "name" ) String applicationName )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("newApplicationForOrganizationFromForm");
+ if (logger.isTraceEnabled()) {
+ logger.trace("newApplicationForOrganizationFromForm");
}
Preconditions.checkArgument( !isEmpty( applicationName ),
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java
index c6f1463..ab601fc 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/imports/ImportsResource.java
@@ -168,9 +168,9 @@ public class ImportsResource extends AbstractContextResource {
final UUID importId = UUID.fromString( entityId.getPath() );
final Import importEntity = importService.getImport( application.getId(), importId );
- if (logger.isDebugEnabled()) {
- logger.debug("Loaded import entity {}:{} with state {}",
- new Object[]{importEntity.getType(), importEntity.getUuid(), importEntity.getState()});
+ if (logger.isTraceEnabled()) {
+ logger.trace("Loaded import entity {}:{} with state {}",
+ importEntity.getType(), importEntity.getUuid(), importEntity.getState());
}
if ( importEntity == null ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/users/UsersResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/users/UsersResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/users/UsersResource.java
index b8d9a73..40ba92e 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/users/UsersResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/users/UsersResource.java
@@ -118,7 +118,7 @@ public class UsersResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback")
String callback ) throws Exception {
- logger.info( "New user for organization: " + username + " (" + email + ")");
+ logger.info( "New user for organization: {} ({})", username, email);
ApiResponse response = createApiResponse();
response.setAction( "create user" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java
index 188567b..1f25a4a 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java
@@ -243,8 +243,8 @@ public class UserResource extends AbstractContextResource {
@FormParam( "recaptcha_challenge_field" ) String challenge,
@FormParam( "recaptcha_response_field" ) String uresponse ) {
- if (logger.isDebugEnabled()) {
- logger.debug("handlePasswordResetForm");
+ if (logger.isTraceEnabled()) {
+ logger.trace("handlePasswordResetForm");
}
final boolean externalTokensEnabled =
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UsersResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UsersResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UsersResource.java
index 640a6c2..a997e18 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UsersResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UsersResource.java
@@ -61,8 +61,8 @@ public class UsersResource extends AbstractContextResource {
public UsersResource() {
- if (logger.isDebugEnabled()) {
- logger.debug("ManagementUsersResource initialized");
+ if (logger.isTraceEnabled()) {
+ logger.trace("ManagementUsersResource initialized");
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/organizations/OrganizationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/organizations/OrganizationResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/organizations/OrganizationResource.java
index a071138..43867e3 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/organizations/OrganizationResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/organizations/OrganizationResource.java
@@ -129,8 +129,8 @@ public class OrganizationResource extends AbstractContextResource {
public ApplicationResource getApplicationByName( @PathParam("applicationName") String applicationName )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("getApplicationByName: " + applicationName);
+ if (logger.isTraceEnabled()) {
+ logger.trace("getApplicationByName: {}", applicationName);
}
if ( "options".equalsIgnoreCase( request.getMethod() ) ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/security/SecuredResourceFilterFactory.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/security/SecuredResourceFilterFactory.java b/stack/rest/src/main/java/org/apache/usergrid/rest/security/SecuredResourceFilterFactory.java
index 77e3a3c..531d355 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/security/SecuredResourceFilterFactory.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/security/SecuredResourceFilterFactory.java
@@ -114,8 +114,8 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
public void configure(ResourceInfo resourceInfo, FeatureContext featureContext) {
Method am = resourceInfo.getResourceMethod();
- if (logger.isDebugEnabled()) {
- logger.debug("configure {} method {}",
+ if (logger.isTraceEnabled()) {
+ logger.trace("configure {} method {}",
resourceInfo.getResourceClass().getSimpleName(), resourceInfo.getResourceMethod().getName());
}
@@ -149,20 +149,20 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
@Override
public void filter(ContainerRequestContext request) throws IOException {
- if (logger.isDebugEnabled()) {
- logger.debug("Filtering {}", request.getUriInfo().getRequestUri().toString());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Filtering {}", request.getUriInfo().getRequestUri().toString());
}
if ( request.getMethod().equalsIgnoreCase( "OPTIONS" ) ) {
- if (logger.isDebugEnabled()) {
- logger.debug("Skipping option request");
+ if (logger.isTraceEnabled()) {
+ logger.trace("Skipping option request");
}
}
MultivaluedMap<java.lang.String, java.lang.String> params = uriInfo.getPathParameters();
- if (logger.isDebugEnabled()) {
- logger.debug("Params: {}", params.keySet());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Params: {}", params.keySet());
}
authorize( request );
@@ -182,8 +182,8 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
}
else {
String applicationName = PathingUtils.assembleAppName( uriInfo.getPathParameters() );
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Pulled applicationName {}", applicationName );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Pulled applicationName {}", applicationName );
}
application = Identifier.fromName( applicationName );
}
@@ -238,19 +238,19 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
@Override
public void authorize( ContainerRequestContext request ) {
- if (logger.isDebugEnabled()) {
- logger.debug("OrganizationFilter.authorize");
+ if (logger.isTraceEnabled()) {
+ logger.trace("OrganizationFilter.authorize");
}
if ( !isPermittedAccessToOrganization( getOrganizationIdentifier() ) ) {
- if (logger.isDebugEnabled()) {
- logger.debug("No organization access authorized");
+ if (logger.isTraceEnabled()) {
+ logger.trace("No organization access authorized");
}
throw mappableSecurityException( "unauthorized", "No organization access authorized" );
}
- if (logger.isDebugEnabled()) {
- logger.debug("OrganizationFilter.authorize - leaving");
+ if (logger.isTraceEnabled()) {
+ logger.trace("OrganizationFilter.authorize - leaving");
}
}
}
@@ -284,8 +284,8 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
@Override
public void authorize( ContainerRequestContext request ) {
- if (logger.isDebugEnabled()) {
- logger.debug("ApplicationFilter.authorize");
+ if (logger.isTraceEnabled()) {
+ logger.trace("ApplicationFilter.authorize");
}
if ( SubjectUtils.isAnonymous() ) {
ApplicationInfo application = null;
@@ -300,8 +300,8 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
Map<String, String> roles = null;
try {
roles = em.getRoles();
- if (logger.isDebugEnabled()) {
- logger.debug("found roles {}", roles);
+ if (logger.isTraceEnabled()) {
+ logger.trace("found roles {}", roles);
}
}
catch ( Exception e ) {
@@ -332,13 +332,13 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
@Override
public void authorize(ContainerRequestContext request) {
- if (logger.isDebugEnabled()) {
- logger.debug("SystemFilter.authorize");
+ if (logger.isTraceEnabled()) {
+ logger.trace("SystemFilter.authorize");
}
try {
if (!request.getSecurityContext().isUserInRole( ROLE_SERVICE_ADMIN )) {
- if (logger.isDebugEnabled()) {
- logger.debug("You are not the system admin.");
+ if (logger.isTraceEnabled()) {
+ logger.trace("You are not the system admin.");
}
throw mappableSecurityException( "unauthorized", "No system access authorized",
SecurityException.REALM );
@@ -365,8 +365,8 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
@Override
public void authorize(ContainerRequestContext request) {
- if (logger.isDebugEnabled()) {
- logger.debug("AdminUserFilter.authorize");
+ if (logger.isTraceEnabled()) {
+ logger.trace("AdminUserFilter.authorize");
}
if (!isUser( getUserIdentifier() )) {
throw mappableSecurityException( "unauthorized", "No admin user access authorized" );
@@ -406,7 +406,7 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
@Override
public void authorize( ContainerRequestContext request ) {
- if(logger.isDebugEnabled()){
+ if(logger.isTraceEnabled()){
logger.debug( "PathPermissionsFilter.authorize" );
}
@@ -432,7 +432,7 @@ public class SecuredResourceFilterFactory implements DynamicFeature {
boolean permitted = currentUser.isPermitted( perm );
if ( logger.isDebugEnabled() ) {
- logger.debug( PATH_MSG, new Object[] { path, operation, perm, permitted } );
+ logger.debug( PATH_MSG, path, operation, perm, permitted );
}
if(!permitted){
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/RestSecurityManager.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/RestSecurityManager.java b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/RestSecurityManager.java
index 4cc7c0e..8e27265 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/RestSecurityManager.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/RestSecurityManager.java
@@ -53,7 +53,7 @@ public class RestSecurityManager extends DefaultWebSecurityManager {
@Override
public void setSessionManager( SessionManager sessionManager ) {
if ( !( sessionManager instanceof HttpRequestSessionManager ) ) {
- logger.info( "Replacing " + sessionManager + " with HttpRequestSessionManager" );
+ logger.info( "Replacing {} with HttpRequestSessionManager", sessionManager );
sessionManager = new HttpRequestSessionManager();
}
super.setSessionManager( sessionManager );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/BasicAuthSecurityFilter.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/BasicAuthSecurityFilter.java b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/BasicAuthSecurityFilter.java
index e516f73..a5d7272 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/BasicAuthSecurityFilter.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/BasicAuthSecurityFilter.java
@@ -45,8 +45,8 @@ public class BasicAuthSecurityFilter extends SecurityFilter {
@Override
public void filter( ContainerRequestContext request ) {
- if(logger.isDebugEnabled()){
- logger.debug("Filtering: " + request.getUriInfo().getBaseUri());
+ if(logger.isTraceEnabled()){
+ logger.trace("Filtering: {}", request.getUriInfo().getBaseUri());
}
@@ -68,8 +68,8 @@ public class BasicAuthSecurityFilter extends SecurityFilter {
if ( name.equals( sysadmin_login_name ) && password.equals( sysadmin_login_password )
&& sysadmin_login_allowed ) {
request.setSecurityContext( new SysAdminRoleAuthenticator() );
- if (logger.isDebugEnabled()) {
- logger.debug("System administrator access allowed");
+ if (logger.isTraceEnabled()) {
+ logger.trace("System administrator access allowed");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/ClientCredentialsSecurityFilter.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/ClientCredentialsSecurityFilter.java b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/ClientCredentialsSecurityFilter.java
index c15c823..83e53c1 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/ClientCredentialsSecurityFilter.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/ClientCredentialsSecurityFilter.java
@@ -51,8 +51,8 @@ public class ClientCredentialsSecurityFilter extends SecurityFilter {
@Override
public void filter( ContainerRequestContext request ) {
- if (logger.isDebugEnabled()) {
- logger.debug("Filtering: " + request.getUriInfo().getBaseUri());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Filtering: {}", request.getUriInfo().getBaseUri());
}
String clientId = httpServletRequest.getParameter( "client_id" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/OAuth2AccessTokenSecurityFilter.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/OAuth2AccessTokenSecurityFilter.java b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/OAuth2AccessTokenSecurityFilter.java
index 7cb96f8..9a82b4a 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/OAuth2AccessTokenSecurityFilter.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/security/shiro/filters/OAuth2AccessTokenSecurityFilter.java
@@ -70,8 +70,8 @@ public class OAuth2AccessTokenSecurityFilter extends SecurityFilter implements C
@Override
public void filter(ContainerRequestContext request) throws IOException {
- if (logger.isDebugEnabled()) {
- logger.debug("Filtering: " + request.getUriInfo().getBaseUri());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Filtering: {}", request.getUriInfo().getBaseUri());
}
try {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/system/ApplicationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/system/ApplicationsResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/system/ApplicationsResource.java
index c023733..22d2c62 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/system/ApplicationsResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/system/ApplicationsResource.java
@@ -124,9 +124,9 @@ public class ApplicationsResource extends AbstractContextResource {
try {
statusService.setStatus(applicationId, jobId, StatusService.Status.FAILED, map).toBlocking().lastOrDefault(null);//leave as subscribe if fails retry
}catch (Exception subE){
- logger.error("failed to update status "+jobId,subE);
+ logger.error("failed to update status {}",jobId,subE);
}
- logger.error( "Failed to delete appid:"+applicationId + " jobid:"+jobId+" count:"+itemsDeleted, e );
+ logger.error( "Failed to delete appid:{} jobid:{} count:{}",applicationId,jobId,itemsDeleted, e );
}
}
};
@@ -139,7 +139,7 @@ public class ApplicationsResource extends AbstractContextResource {
//should throw exception if can't start
statusService.setStatus(applicationId, jobId, StatusService.Status.STARTED, new LinkedHashMap<>()).toBlocking().lastOrDefault(null);
}catch (Exception e){
- logger.error("failed to set status for " + jobId, e);
+ logger.error("failed to set status for {}", jobId, e);
}
Map<String,Object> data = new HashMap<>();
data.put("jobId",jobId);
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/system/DatabaseResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/system/DatabaseResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/system/DatabaseResource.java
index f3ce8b7..b264893 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/system/DatabaseResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/system/DatabaseResource.java
@@ -66,7 +66,7 @@ public class DatabaseResource extends AbstractContextResource {
ApiResponse response = createApiResponse();
response.setAction( "cassandra setup" );
- logger.info( "Setting up Cassandra" );
+ logger.info( "Setting up Cassandra (runDatabaseSetup)" );
emf.setup();
@@ -89,7 +89,7 @@ public class DatabaseResource extends AbstractContextResource {
ApiResponse response = createApiResponse();
response.setAction( "cassandra setup" );
- logger.info( "Setting up Cassandra" );
+ logger.info( "Setting up Cassandra (runSystemSetup)" );
emf.boostrap();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/system/IndexResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/system/IndexResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/system/IndexResource.java
index 3f36bfe..4a521b3 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/system/IndexResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/system/IndexResource.java
@@ -93,7 +93,9 @@ public class IndexResource extends AbstractContextResource {
throws Exception {
- logger.info("Getting status for index jobs");
+ if (logger.isTraceEnabled()) {
+ logger.trace("Getting status for index jobs");
+ }
Preconditions
.checkNotNull(jobId, "query param jobId must not be null" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/system/MigrateResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/system/MigrateResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/system/MigrateResource.java
index 87d7ccb..5bfeac9 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/system/MigrateResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/system/MigrateResource.java
@@ -137,13 +137,13 @@ public class MigrateResource extends AbstractContextResource {
@Override
public void run() {
- logger.info( "Migrating Data for plugin: " + pluginName );
+ logger.info( "Migrating Data for plugin: {}", pluginName );
try {
getDataMigrationManager().migrate(pluginName);
}
catch ( Exception e ) {
- logger.error( "Unable to migrate data for plugin: " + pluginName, e );
+ logger.error( "Unable to migrate data for plugin: {}", pluginName, e );
}
}
};
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
index dfb4fe0..035051f 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
@@ -43,7 +43,6 @@ import static org.junit.Assert.fail;
/**
* // TODO: Document this
*
- * @author ApigeeCorporation
* @since 4.0
*/
public class GeoPagingTest extends AbstractRestIT {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
index e052264..a190526 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
@@ -33,7 +33,6 @@ import static org.junit.Assert.assertEquals;
/**
* // TODO: Document this
*
- * @author ApigeeCorporation
* @since 4.0
*/
public class OrderByTest extends QueryTestBase {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/ApiResponse.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/ApiResponse.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/ApiResponse.java
index 471cf5e..d476248 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/ApiResponse.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/ApiResponse.java
@@ -1,6 +1,3 @@
-/**
- * Created by ApigeeCorporation on 12/4/14.
- */
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/Collection.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/Collection.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/Collection.java
index 5bbc0dc..c819f59 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/Collection.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/model/Collection.java
@@ -1,6 +1,3 @@
-/**
- * Created by ApigeeCorporation on 12/4/14.
- */
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/services/src/main/java/org/apache/usergrid/management/cassandra/AccountCreationPropsImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/AccountCreationPropsImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/AccountCreationPropsImpl.java
index 0aedf39..7c6a091 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/AccountCreationPropsImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/AccountCreationPropsImpl.java
@@ -86,7 +86,7 @@ public class AccountCreationPropsImpl implements AccountCreationProps {
public String getProperty( String name ) {
String propertyValue = properties.getProperty( name );
if ( isBlank( propertyValue ) ) {
- logger.warn( "Missing value for " + name );
+ logger.warn( "Missing value for {}", name );
propertyValue = null;
}
return propertyValue;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index 558b718..a3a6aa9 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -365,9 +365,7 @@ public class ManagementServiceImpl implements ManagementService {
try {
createAdminUser( null, username, "Super User", email, password, true, false );
}catch(Exception e){
- if (logger.isInfoEnabled()) {
- logger.info("resetSuperUser: auto creation of superuser failed: {}", e.getMessage());
- }
+ logger.info("resetSuperUser: auto creation of superuser failed: {}", e.getMessage());
}
}
else {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/services/src/main/java/org/apache/usergrid/services/exceptions/AwsPropertiesNotFoundException.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/exceptions/AwsPropertiesNotFoundException.java b/stack/services/src/main/java/org/apache/usergrid/services/exceptions/AwsPropertiesNotFoundException.java
index c2933b0..cfd2974 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/exceptions/AwsPropertiesNotFoundException.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/exceptions/AwsPropertiesNotFoundException.java
@@ -21,9 +21,6 @@ package org.apache.usergrid.services.exceptions;
import static org.apache.usergrid.utils.JsonUtils.mapToJsonString;
-/**
- * Created by ApigeeCorporation on 7/23/15.
- */
public class AwsPropertiesNotFoundException extends RuntimeException {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java
index fa75531..2ce381d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java
@@ -26,9 +26,6 @@ import org.elasticsearch.common.primitives.Longs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/**
- * Created by ApigeeCorporation on 9/4/14.
- */
public class ApplicationQueueMessage implements Serializable {
private static final Logger log = LoggerFactory.getLogger(ApplicationQueueMessage.class);
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationServiceProxy.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationServiceProxy.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationServiceProxy.java
index 7712163..0caa182 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationServiceProxy.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationServiceProxy.java
@@ -21,9 +21,6 @@ import org.apache.usergrid.persistence.entities.Notifier;
import java.util.Set;
-/**
- * Created by ApigeeCorporation on 8/6/14.
- */
public interface NotificationServiceProxy {
public void finishedBatch(Notification notification, long successes, long failures) throws Exception;
[2/7] usergrid git commit: USERGRID-1243: logging overhaul, pt. 1
Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
index a49e217..9427be1 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
@@ -19,7 +19,6 @@
package org.apache.usergrid.persistence.index.impl;
-import java.util.List;
import java.util.UUID;
import org.apache.usergrid.persistence.index.*;
@@ -31,12 +30,11 @@ import org.apache.usergrid.persistence.core.util.ValidationUtils;
import org.apache.usergrid.persistence.index.utils.IndexValidationUtils;
import org.apache.usergrid.persistence.model.entity.Entity;
import org.apache.usergrid.persistence.model.entity.Id;
-import rx.Observable;
public class EsEntityIndexBatchImpl implements EntityIndexBatch {
- private static final Logger log = LoggerFactory.getLogger( EsEntityIndexBatchImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( EsEntityIndexBatchImpl.class );
private final IndexAlias alias;
@@ -70,9 +68,9 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
final String writeAlias = alias.getWriteAlias();
- if ( log.isDebugEnabled() ) {
- log.debug( "Indexing to alias {} with scope {} on edge {} with entity data {}",
- new Object[] { writeAlias, applicationScope, indexEdge, entity } );
+ if ( logger.isDebugEnabled() ) {
+ logger.debug( "Indexing to alias {} with scope {} on edge {} with entity data {}",
+ writeAlias, applicationScope, indexEdge, entity );
}
//add app id for indexing
@@ -94,9 +92,9 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
throw new IllegalStateException("No indexes exist for " + indexLocationStrategy.getAlias().getWriteAlias());
}
- if ( log.isDebugEnabled() ) {
- log.debug( "Deindexing to indexes {} with scope {} on edge {} with id {} and version {} ",
- new Object[] { indexes, applicationScope, searchEdge, id, version } );
+ if ( logger.isDebugEnabled() ) {
+ logger.debug( "Deindexing to indexes {} with scope {} on edge {} with id {} and version {} ",
+ indexes, applicationScope, searchEdge, id, version );
}
@@ -113,9 +111,9 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
throw new IllegalStateException("No indexes exist for " + indexLocationStrategy.getAlias().getWriteAlias());
}
- if ( log.isDebugEnabled() ) {
- log.debug( "Deindexing to indexes {} with with documentId {} ",
- new Object[] { indexes, docId } );
+ if ( logger.isDebugEnabled() ) {
+ logger.debug( "Deindexing to indexes {} with with documentId {} ",
+ indexes, docId );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index 0cfa18b..ba3af95 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -293,7 +293,9 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
// to receive documents. Occasionally we see errors.
// See this post: http://s.apache.org/index-missing-exception
- logger.debug("Testing new index name: read {} write {}", alias.getReadAlias(), alias.getWriteAlias());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Testing new index name: read {} write {}", alias.getReadAlias(), alias.getWriteAlias());
+ }
final RetryOperation retryOperation = () -> {
final String tempId = UUIDGenerator.newTimeUUID().toString();
@@ -301,15 +303,18 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
esProvider.getClient().prepareIndex( alias.getWriteAlias(), VERIFY_TYPE, tempId )
.setSource(DEFAULT_PAYLOAD).get();
- logger.info( "Successfully created new document with docId {} "
- + "in index read {} write {} and type {}",
- tempId, alias.getReadAlias(), alias.getWriteAlias(), VERIFY_TYPE );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Successfully created new document with docId {} in index read {} write {} and type {}",
+ tempId, alias.getReadAlias(), alias.getWriteAlias(), VERIFY_TYPE);
+ }
// delete all types, this way if we miss one it will get cleaned up
esProvider.getClient().prepareDelete( alias.getWriteAlias(), VERIFY_TYPE, tempId).get();
- logger.info( "Successfully deleted documents in read {} write {} and type {} with id {}",
- alias.getReadAlias(), alias.getWriteAlias(), VERIFY_TYPE, tempId );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Successfully deleted documents in read {} write {} and type {} with id {}",
+ alias.getReadAlias(), alias.getWriteAlias(), VERIFY_TYPE, tempId);
+ }
return true;
};
@@ -359,7 +364,9 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
String[] indexes = getIndexes();
if (indexes.length == 0) {
- logger.debug("Not refreshing indexes. none found");
+ if (logger.isTraceEnabled()) {
+ logger.trace("Not refreshing indexes. none found");
+ }
}
//Added For Graphite Metrics
RefreshResponse response =
@@ -372,8 +379,10 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
logger.error("Failed to refresh index:{} reason:{}", sfe.index(), sfe.reason());
}
}
- logger.debug("Refreshed indexes: {},success:{} failed:{} ", StringUtils.join(indexes, ", "),
- successfulShards, failedShards);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Refreshed indexes: {},success:{} failed:{} ", StringUtils.join(indexes, ", "),
+ successfulShards, failedShards);
+ }
IndexRefreshCommandInfo refreshResults = new IndexRefreshCommandInfo(failedShards == 0,
System.currentTimeMillis() - start);
@@ -647,10 +656,10 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
final ShardOperationFailedException[] failures = indexDeleteByQueryResponse.getFailures();
for ( ShardOperationFailedException failedException : failures ) {
- logger.error( String.format( "Unable to delete by query %s. "
- + "Failed with code %d and reason %s on shard %s in index %s", query.toString(),
+ logger.error("Unable to delete by query {}. Failed with code {} and reason {} on shard {} in index {}",
+ query.toString(),
failedException.status().getStatus(), failedException.reason(),
- failedException.shardId(), failedException.index() ) );
+ failedException.shardId(), failedException.index() );
}
}
}
@@ -665,7 +674,9 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
final SearchHits searchHits = searchResponse.getHits();
final SearchHit[] hits = searchHits.getHits();
- logger.debug( " Hit count: {} Total hits: {}", hits.length, searchHits.getTotalHits() );
+ if (logger.isTraceEnabled()) {
+ logger.trace(" Hit count: {} Total hits: {}", hits.length, searchHits.getTotalHits());
+ }
List<CandidateResult> candidates = new ArrayList<>( hits.length );
@@ -706,8 +717,8 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
if(candidateResult.getVersion().timestamp() <= markedVersion.timestamp()){
- if(logger.isDebugEnabled()){
- logger.debug("Candidate version {} is <= provided entity version {} for entityId {}",
+ if(logger.isTraceEnabled()){
+ logger.trace("Candidate version {} is <= provided entity version {} for entityId {}",
candidateResult.getVersion(),
markedVersion,
candidateResult.getId()
@@ -717,8 +728,8 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
candidates.add(candidateResult);
}else{
- if(logger.isDebugEnabled()){
- logger.debug("Candidate version {} is > provided entity version {} for entityId {}. Not" +
+ if(logger.isTraceEnabled()){
+ logger.trace("Candidate version {} is > provided entity version {} for entityId {}. Not" +
"adding to candidate results",
candidateResult.getVersion(),
markedVersion,
@@ -732,7 +743,9 @@ public class EsEntityIndexImpl implements EntityIndex,VersionedData {
}
}
- logger.debug( "Aggregated {} out of {} hits ",candidates.size(),searchHits.getTotalHits() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Aggregated {} out of {} hits ", candidates.size(), searchHits.getTotalHits());
+ }
return candidates;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexProducerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexProducerImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexProducerImpl.java
index f9dd114..4782bea 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexProducerImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexProducerImpl.java
@@ -51,7 +51,7 @@ import rx.Observable;
*/
@Singleton
public class EsIndexProducerImpl implements IndexProducer {
- private static final Logger log = LoggerFactory.getLogger( EsIndexProducerImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( EsIndexProducerImpl.class );
private final IndexFig config;
private final FailureMonitorImpl failureMonitor;
@@ -116,7 +116,9 @@ public class EsIndexProducerImpl implements IndexProducer {
final int indexOperationSetSize = indexOperationSet.size();
final int deIndexOperationSetSize = deIndexOperationSet.size();
- log.debug("Emitting {} add and {} remove operations", indexOperationSetSize, deIndexOperationSetSize);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Emitting {} add and {} remove operations", indexOperationSetSize, deIndexOperationSetSize);
+ }
indexSizeCounter.dec(indexOperationSetSize);
indexSizeCounter.dec(deIndexOperationSetSize);
@@ -133,7 +135,9 @@ public class EsIndexProducerImpl implements IndexProducer {
.flatMap(individualOps -> Observable.from(individualOps)
//collect them
.collect(() -> initRequest(), (bulkRequestBuilder, batchOperation) -> {
- log.debug("adding operation {} to bulkRequestBuilder {}", batchOperation, bulkRequestBuilder);
+ if (logger.isTraceEnabled()) {
+ logger.trace("adding operation {} to bulkRequestBuilder {}", batchOperation, bulkRequestBuilder);
+ }
batchOperation.doOperation(client, bulkRequestBuilder);
}))
//write them
@@ -188,7 +192,7 @@ public class EsIndexProducerImpl implements IndexProducer {
try {
responses = bulkRequest.execute().actionGet( );
} catch ( Throwable t ) {
- log.error( "Unable to communicate with elasticsearch", t );
+ logger.error( "Unable to communicate with elasticsearch", t );
failureMonitor.fail( "Unable to execute batch", t );
throw t;
}finally{
@@ -206,7 +210,7 @@ public class EsIndexProducerImpl implements IndexProducer {
if ( response.isFailed() ) {
// log error and continue processing
- log.error( "Unable to index id={}, type={}, index={}, failureMessage={} ", response.getId(),
+ logger.error( "Unable to index id={}, type={}, index={}, failureMessage={} ", response.getId(),
response.getType(), response.getIndex(), response.getFailureMessage() );
//if index is overloaded on the queue fail.
if(response.getFailure()!=null && response.getFailure().getStatus() == RestStatus.TOO_MANY_REQUESTS){
@@ -221,8 +225,8 @@ public class EsIndexProducerImpl implements IndexProducer {
if ( error ) {
if(hasTooManyRequests){
try{
- log.warn("Encountered Queue Capacity Exception from ElasticSearch slowing by "
- + indexFig.getSleepTimeForQueueError() );
+ logger.warn("Encountered Queue Capacity Exception from ElasticSearch slowing by {}",
+ indexFig.getSleepTimeForQueueError() );
Thread.sleep(indexFig.getSleepTimeForQueueError());
}catch (Exception e){
//move on
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
index 096bd17..60c41f6 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
@@ -46,7 +46,7 @@ import com.google.inject.Singleton;
@Singleton
public class EsProvider {
- private static final Logger log = LoggerFactory.getLogger( EsProvider.class );
+ private static final Logger logger = LoggerFactory.getLogger( EsProvider.class );
private final IndexFig indexFig;
private static Client client;
@@ -135,7 +135,7 @@ public class EsProvider {
}
catch ( UnknownHostException ex ) {
nodeName = "client-" + RandomStringUtils.randomAlphabetic( 8 );
- log.warn( "Couldn't get hostname to use as ES node name, using " + nodeName );
+ logger.warn( "Couldn't get hostname to use as ES node name, using {}", nodeName );
}
}
@@ -196,7 +196,9 @@ public class EsProvider {
.build();
- log.debug( "Creating ElasticSearch client with settings: {}", settings.getAsMap() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Creating ElasticSearch client with settings: {}", settings.getAsMap());
+ }
Node node = NodeBuilder.nodeBuilder().settings( settings ).client( true ).data( false ).node();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/FailureMonitorImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/FailureMonitorImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/FailureMonitorImpl.java
index 7de3a7c..943eabb 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/FailureMonitorImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/FailureMonitorImpl.java
@@ -37,7 +37,7 @@ import org.apache.usergrid.persistence.index.IndexFig;
*/
public class FailureMonitorImpl implements FailureMonitor {
- private static final Logger LOG = LoggerFactory.getLogger( FailureMonitorImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( FailureMonitorImpl.class );
/**
* Exceptions that will cause us to increment our count and restart
@@ -74,9 +74,8 @@ public class FailureMonitorImpl implements FailureMonitor {
final int maxCount = indexFig.getFailRefreshCount();
if ( fails > maxCount ) {
- LOG.error( "Unable to connect to elasticsearch. Reason is {}", message, throwable );
- LOG.warn( "We have failed to connect to Elastic Search {} times. "
- + "Max allowed is {}. Resetting connection", fails, maxCount );
+ logger.error( "Unable to connect to elasticsearch. Reason is {}", message, throwable );
+ logger.warn( "We have failed to connect to Elastic Search {} times. Max allowed is {}. Resetting connection", fails, maxCount );
esProvider.releaseClient();
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexMappingMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexMappingMigrationPlugin.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexMappingMigrationPlugin.java
index e29ed81..246c448 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexMappingMigrationPlugin.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexMappingMigrationPlugin.java
@@ -70,7 +70,7 @@ public class EsIndexMappingMigrationPlugin implements MigrationPlugin {
final int version = migrationInfoSerialization.getVersion(getName());
if (version == getMaxVersion()) {
- logger.debug("Skipping Migration Plugin: " + getName());
+ logger.debug("Skipping Migration Plugin: {}", getName());
return;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/ParsedQueryBuilder.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/ParsedQueryBuilder.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/ParsedQueryBuilder.java
index bb79e37..4b15332 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/ParsedQueryBuilder.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/ParsedQueryBuilder.java
@@ -53,7 +53,9 @@ public class ParsedQueryBuilder {
if ( StringUtils.isEmpty( ql ) ) {
return null;
}
- logger.debug( "Processing raw query: " + ql );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Processing raw query: {}", ql);
+ }
final String trimmedLowercaseQuery = ql.trim().toLowerCase();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ConversionUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ConversionUtils.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ConversionUtils.java
index 503d597..1aaf380 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ConversionUtils.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ConversionUtils.java
@@ -643,7 +643,7 @@ public class ConversionUtils {
}
}
catch ( Exception e ) {
- logger.error( "Unable to get object from bytes for type " + type.getName(), e );
+ logger.error( "Unable to get object from bytes for type {}", type.getName(), e );
}
return null;
}
@@ -683,7 +683,7 @@ public class ConversionUtils {
}
}
catch ( Exception e ) {
- logger.error( "Unable to get object from bytes for type " + type.getName(), e );
+ logger.error( "Unable to get object from bytes for type {}", type.getName(), e );
}
return null;
}
@@ -748,7 +748,7 @@ public class ConversionUtils {
}
}
catch ( Exception e ) {
- logger.error( "Unable to get object from bytes for type " + type.getName(), e );
+ logger.error( "Unable to get object from bytes for type {}", type.getName(), e );
}
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java
index 26395b4..c93428e 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/ListUtils.java
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
public class ListUtils extends org.apache.commons.collections.ListUtils {
- private static final Logger LOG = LoggerFactory.getLogger( ListUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( ListUtils.class );
public static <A> A first( List<A> list ) {
@@ -69,7 +69,7 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
return NumberUtils.toInt( ( String ) a );
}
catch ( Exception e ) {
- LOG.warn( "Could not convert list item {} to int", a, e );
+ logger.warn( "Could not convert list item {} to int", a, e );
}
return null;
}
@@ -89,7 +89,7 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
return NumberUtils.toLong( ( String ) a );
}
catch ( Exception e ) {
- LOG.warn( "Could not convert list item {} to long", a, e );
+ logger.warn( "Could not convert list item {} to long", a, e );
}
return null;
}
@@ -109,7 +109,7 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
return Boolean.parseBoolean( ( String ) a );
}
catch ( Exception e ) {
- LOG.warn( "Could not convert list item {} to boolean", a, e );
+ logger.warn( "Could not convert list item {} to boolean", a, e );
}
return null;
}
@@ -129,7 +129,7 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
return UUIDUtils.tryGetUUID( ( String ) i );
}
catch ( Exception e ) {
- LOG.warn( "Could not convert list item {} to UUID", i, e );
+ logger.warn( "Could not convert list item {} to UUID", i, e );
}
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
index d71c47e..eb6651f 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoPagingTest.java
@@ -58,7 +58,6 @@ import static org.junit.Assert.fail;
/**
* // TODO: Document this
*
- * @author ApigeeCorporation
* @since 4.0
*/
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueScopeImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueScopeImpl.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueScopeImpl.java
index 09a0bcd..fa50b49 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueScopeImpl.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/QueueScopeImpl.java
@@ -20,9 +20,6 @@ package org.apache.usergrid.persistence.queue.impl;
import org.apache.usergrid.persistence.model.entity.Id;
import org.apache.usergrid.persistence.queue.QueueScope;
-/**
- * Created by ApigeeCorporation on 10/3/14.
- */
public class QueueScopeImpl implements QueueScope {
private final String name;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
index 31b478d..3a1f045 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
@@ -183,27 +183,27 @@ public class SNSQueueManagerImpl implements QueueManager {
String primaryTopicArn = AmazonNotificationUtils.getTopicArn( sns, queueName, true );
- if ( logger.isDebugEnabled() ) {
- logger.debug( "SNS/SQS Setup: primaryTopicArn=" + primaryTopicArn );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "SNS/SQS Setup: primaryTopicArn={}", primaryTopicArn );
}
String queueUrl = AmazonNotificationUtils.getQueueUrlByName( sqs, queueName );
String primaryQueueArn = AmazonNotificationUtils.getQueueArnByName( sqs, queueName );
- if ( logger.isDebugEnabled() ) {
- logger.debug( "SNS/SQS Setup: primaryQueueArn=" + primaryQueueArn );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "SNS/SQS Setup: primaryQueueArn={}", primaryQueueArn );
}
if ( primaryQueueArn == null ) {
- if ( logger.isDebugEnabled() ) {
- logger.debug( "SNS/SQS Setup: primaryQueueArn is null, creating queue..." );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "SNS/SQS Setup: primaryQueueArn is null, creating queue..." );
}
queueUrl = AmazonNotificationUtils.createQueue( sqs, queueName, fig );
primaryQueueArn = AmazonNotificationUtils.getQueueArnByUrl( sqs, queueUrl );
- if ( logger.isDebugEnabled() ) {
- logger.debug( "SNS/SQS Setup: New Queue URL=[{}] ARN=[{}]", queueUrl, primaryQueueArn );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "SNS/SQS Setup: New Queue URL=[{}] ARN=[{}]", queueUrl, primaryQueueArn );
}
}
@@ -219,15 +219,15 @@ public class SNSQueueManagerImpl implements QueueManager {
}
catch ( AmazonServiceException e ) {
logger.error(
- String.format( "Unable to subscribe PRIMARY queue=[%s] to topic=[%s]", queueUrl, primaryTopicArn ), e );
+ "Unable to subscribe PRIMARY queue=[{}] to topic=[{}]", queueUrl, primaryTopicArn, e );
}
if ( fig.isMultiRegion() && scope.getRegionImplementation() == QueueScope.RegionImplementation.ALL ) {
String multiRegion = fig.getRegionList();
- if ( logger.isDebugEnabled() ) {
- logger.debug( "MultiRegion Setup specified, regions: [{}]", multiRegion );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "MultiRegion Setup specified, regions: [{}]", multiRegion );
}
String[] regionNames = multiRegion.split( "," );
@@ -261,7 +261,9 @@ public class SNSQueueManagerImpl implements QueueManager {
arrQueueArns.put( queueArn, regionName );
}
- logger.debug( "Creating Subscriptions..." );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Creating Subscriptions...");
+ }
for ( Map.Entry<String, String> queueArnEntry : arrQueueArns.entrySet() ) {
String queueARN = queueArnEntry.getKey();
@@ -297,20 +299,21 @@ public class SNSQueueManagerImpl implements QueueManager {
SubscribeResult subscribeResult = subscribeSnsClient.subscribe( subscribeRequest );
String subscriptionARN = subscribeResult.getSubscriptionArn();
- if ( logger.isDebugEnabled() ) {
- logger.debug(
+ if ( logger.isTraceEnabled() ) {
+ logger.trace(
"Successfully subscribed Queue ARN=[{}] to Topic ARN=[{}], subscription ARN=[{}]",
queueARN, topicARN, subscriptionARN );
}
}
catch ( Exception e ) {
- logger.error( String
- .format( "ERROR Subscribing Queue ARN/Region=[%s / %s] and Topic ARN/Region=[%s / %s]",
- queueARN, strSqsRegion, topicARN, strSnsRegion ), e );
+ logger.error( "ERROR Subscribing Queue ARN/Region=[{} / {}] and Topic ARN/Region=[{} / {}]",
+ queueARN, strSqsRegion, topicARN, strSnsRegion , e );
}
}
- logger.info( "Adding permission to receive messages..." );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Adding permission to receive messages...");
+ }
// add permission to each queue, providing a list of topics that it's subscribed to
AmazonNotificationUtils
.setQueuePermissionsToReceive( subscribeSqsClient, subscribeQueueUrl, topicArnList );
@@ -409,8 +412,8 @@ public class SNSQueueManagerImpl implements QueueManager {
String url = getReadQueue().getUrl();
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Getting up to {} messages from {}", limit, url );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Getting up to {} messages from {}", limit, url );
}
ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest( url );
@@ -422,8 +425,8 @@ public class SNSQueueManagerImpl implements QueueManager {
ReceiveMessageResult result = sqs.receiveMessage( receiveMessageRequest );
List<Message> messages = result.getMessages();
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Received {} messages from {}", messages.size(), url );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Received {} messages from {}", messages.size(), url );
}
List<QueueMessage> queueMessages = new ArrayList<>( messages.size() );
@@ -452,7 +455,7 @@ public class SNSQueueManagerImpl implements QueueManager {
}
}
catch ( Exception e ) {
- logger.error( String.format( "failed to deserialize message: %s", message.getBody() ), e );
+ logger.error( "failed to deserialize message: {}", message.getBody(), e );
throw new RuntimeException( e );
}
@@ -465,10 +468,10 @@ public class SNSQueueManagerImpl implements QueueManager {
return queueMessages ;
}
catch ( com.amazonaws.services.sqs.model.QueueDoesNotExistException dne ) {
- logger.error( String.format( "Queue does not exist! [%s]", url ), dne );
+ logger.error( "Queue does not exist! [{}]", url , dne );
}
catch ( Exception e ) {
- logger.error( String.format( "Programming error getting messages from queue=[%s] exist!", url ), e );
+ logger.error( "Programming error getting messages from queue=[{}] exist!", url, e );
}
return new ArrayList<>( 0 ) ;
@@ -516,8 +519,8 @@ public class SNSQueueManagerImpl implements QueueManager {
String topicArn = getWriteTopicArn();
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Publishing Message...{} to arn: {}", stringBody, topicArn );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Publishing Message...{} to arn: {}", stringBody, topicArn );
}
PublishRequest publishRequest = new PublishRequest( topicArn, stringBody );
@@ -531,8 +534,8 @@ public class SNSQueueManagerImpl implements QueueManager {
@Override
public void onSuccess( PublishRequest request, PublishResult result ) {
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Successfully published... messageID=[{}], arn=[{}]", result.getMessageId(),
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Successfully published... messageID=[{}], arn=[{}]", result.getMessageId(),
request.getTopicArn() );
}
}
@@ -566,8 +569,8 @@ public class SNSQueueManagerImpl implements QueueManager {
String url = getReadQueue().getUrl();
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Publishing Message...{} to url: {}", stringBody, url );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Publishing Message...{} to url: {}", stringBody, url );
}
SendMessageRequest request = new SendMessageRequest( url, stringBody );
@@ -583,8 +586,8 @@ public class SNSQueueManagerImpl implements QueueManager {
@Override
public void onSuccess( final SendMessageRequest request, final SendMessageResult sendMessageResult ) {
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Successfully send... messageBody=[{}], url=[{}]", request.getMessageBody(),
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Successfully send... messageBody=[{}], url=[{}]", request.getMessageBody(),
request.getQueueUrl() );
}
}
@@ -604,8 +607,8 @@ public class SNSQueueManagerImpl implements QueueManager {
@Override
public void commitMessage( final QueueMessage queueMessage ) {
String url = getReadQueue().getUrl();
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Commit message {} to queue {}", queueMessage.getMessageId(), url );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Commit message {} to queue {}", queueMessage.getMessageId(), url );
}
sqs.deleteMessage(
@@ -617,8 +620,8 @@ public class SNSQueueManagerImpl implements QueueManager {
public void commitMessages( final List<QueueMessage> queueMessages ) {
String url = getReadQueue().getUrl();
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Commit messages {} to queue {}", queueMessages.size(), url );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Commit messages {} to queue {}", queueMessages.size(), url );
}
List<DeleteMessageBatchRequestEntry> entries = new ArrayList<>();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/util/AmazonNotificationUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/util/AmazonNotificationUtils.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/util/AmazonNotificationUtils.java
index d57870d..b6b1aaa 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/util/AmazonNotificationUtils.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/util/AmazonNotificationUtils.java
@@ -131,7 +131,7 @@ public class AmazonNotificationUtils {
return null;
}
catch ( Exception e ) {
- logger.error( String.format( "Failed to get URL for Queue [%s] from SQS", queueName ), e );
+ logger.error( "Failed to get URL for Queue [{}] from SQS", queueName, e );
throw e;
}
@@ -177,8 +177,8 @@ public class AmazonNotificationUtils {
public static String getTopicArn( final AmazonSNSClient sns, final String queueName, final boolean createOnMissing )
throws Exception {
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Looking up Topic ARN: {}", queueName );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Looking up Topic ARN: {}", queueName );
}
ListTopicsResult listTopicsResult = sns.listTopics();
@@ -190,25 +190,31 @@ public class AmazonNotificationUtils {
if ( queueName.equals( arn.substring( arn.lastIndexOf( ':' ) ) ) ) {
topicArn = arn;
- logger.info( "Found existing topic arn=[{}] for queue=[{}]", topicArn, queueName );
+ if (logger.isTraceEnabled()) {
+ logger.trace( "Found existing topic arn=[{}] for queue=[{}]", topicArn, queueName );
+ }
}
}
if ( topicArn == null && createOnMissing ) {
- logger.info( "Creating topic for queue=[{}]...", queueName );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Creating topic for queue=[{}]...", queueName);
+ }
CreateTopicResult createTopicResult = sns.createTopic( queueName );
topicArn = createTopicResult.getTopicArn();
- logger.info( "Successfully created topic with name {} and arn {}", queueName, topicArn );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Successfully created topic with name {} and arn {}", queueName, topicArn);
+ }
}
else {
logger.error( "Error looking up topic ARN for queue=[{}] and createOnMissing=[{}]", queueName,
createOnMissing );
}
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Returning Topic ARN=[{}] for Queue=[{}]", topicArn, queueName );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Returning Topic ARN=[{}] for Queue=[{}]", topicArn, queueName );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index e97e16e..a72e6f3 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -115,7 +115,7 @@
<log4j-version>1.2.16</log4j-version>
<org.springframework.version>3.2.13.RELEASE</org.springframework.version>
<shiro-version>1.2.4</shiro-version>
- <slf4j-version>1.6.1</slf4j-version>
+ <slf4j-version>1.7.2</slf4j-version>
<snakeyaml-version>1.9</snakeyaml-version>
<tomcat-version>7.0.64</tomcat-version>
<antlr.version>3.4</antlr.version>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java
index 68c894b..da41b59 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java
@@ -116,8 +116,8 @@ public abstract class AbstractContextResource {
public <T extends AbstractContextResource> T getSubResource(Class<T> t) {
- if (logger.isDebugEnabled()) {
- logger.debug("getSubResource: " + t.getCanonicalName());
+ if (logger.isTraceEnabled()) {
+ logger.trace("getSubResource: {}", t.getCanonicalName());
}
T subResource = resourceContext.getResource(t);
subResource.setParent(this);
@@ -175,13 +175,13 @@ public abstract class AbstractContextResource {
if (StringUtils.isNotBlank(redirect_url)) {
if (logger.isDebugEnabled()) {
- logger.debug("Redirecting to URL: ", redirect_url);
+ logger.debug("Redirecting to URL: {}", redirect_url);
}
sendRedirect(redirect_url);
}
- if (logger.isDebugEnabled()) {
- logger.debug("Dispatching to viewable with template: {}", template, template_property);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Dispatching to viewable with template: {} property: {}", template, template_property);
}
Viewable viewable = new Viewable(template, model);
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
index 4b30010..b7118a3 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
@@ -102,7 +102,9 @@ public class RootResource extends AbstractContextResource implements MetricProce
@QueryParam("deleted") @DefaultValue("false") Boolean deleted,
@QueryParam("callback") @DefaultValue("callback") String callback ) throws URISyntaxException {
- logger.info( "RootResource.getData" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("RootResource.getData");
+ }
ApiResponse response = createApiResponse();
response.setAction( "get applications" );
@@ -340,8 +342,8 @@ public class RootResource extends AbstractContextResource implements MetricProce
@Path("orgs/{organizationName}")
public OrganizationResource getOrganizationByName3( @PathParam("organizationName") String organizationName )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("getOrganizationByName3");
+ if (logger.isTraceEnabled()) {
+ logger.trace("getOrganizationByName3");
}
return getOrganizationByName( organizationName );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java b/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java
index e7fad4d..f272c6b 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java
@@ -62,7 +62,9 @@ public class SwaggerServlet extends HttpServlet implements Filter {
@Override
public void init( ServletConfig config ) throws ServletException {
super.init( config );
- logger.info( "init(ServletConfig config)" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("init(ServletConfig config)");
+ }
if ( sc == null ) {
sc = config.getServletContext();
}
@@ -73,7 +75,9 @@ public class SwaggerServlet extends HttpServlet implements Filter {
@Override
public void init( FilterConfig config ) throws ServletException {
- logger.info( "init(FilterConfig paramFilterConfig)" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("init(FilterConfig paramFilterConfig)");
+ }
if ( sc == null ) {
sc = config.getServletContext();
}
@@ -107,7 +111,9 @@ public class SwaggerServlet extends HttpServlet implements Filter {
public void loadSwagger() {
- logger.info( "loadSwagger()" );
+ if (logger.isTraceEnabled()) {
+ logger.trace( "loadSwagger()" );
+ }
pathToJson.put( "/resources.json", loadTempate( "/swagger/resources.json" ) );
pathToJson.put( "/applications.json", loadTempate( "/swagger/applications.json" ) );
pathToJson.put( "/management.json", loadTempate( "/swagger/management.json" ) );
@@ -120,7 +126,9 @@ public class SwaggerServlet extends HttpServlet implements Filter {
String path = request.getServletPath();
- logger.info( "Swagger request: " + path );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Swagger request: {}" + path);
+ }
handleJsonOutput( request, response );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ApplicationResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ApplicationResource.java
index 5d76b3b..d384cb6 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ApplicationResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ApplicationResource.java
@@ -153,8 +153,8 @@ public class ApplicationResource extends ServiceResource {
@RequireApplicationAccess
@Path("assets")
public AssetsResource getAssetsResource( @Context UriInfo ui ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("in assets n applicationResource");
+ if (logger.isTraceEnabled()) {
+ logger.trace("in assets n applicationResource");
}
addParameter( getServiceParameters(), "assets" );
@@ -171,8 +171,8 @@ public class ApplicationResource extends ServiceResource {
@Path("asset")
public AssetsResource getAssetResource( @Context UriInfo ui ) throws Exception {
// TODO change to singular
- if (logger.isDebugEnabled()) {
- logger.debug("in asset in applicationResource");
+ if (logger.isTraceEnabled()) {
+ logger.trace("in asset in applicationResource");
}
return getAssetsResource( ui );
}
@@ -180,8 +180,8 @@ public class ApplicationResource extends ServiceResource {
@Path("users")
public UsersResource getUsers( @Context UriInfo ui ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("ApplicationResource.getUsers");
+ if (logger.isTraceEnabled()) {
+ logger.trace("ApplicationResource.getUsers");
}
addParameter( getServiceParameters(), "users" );
@@ -210,8 +210,8 @@ public class ApplicationResource extends ServiceResource {
@QueryParam("ttl") long ttl, @QueryParam("redirect_uri") String redirect_uri,
@QueryParam("callback") @DefaultValue("") String callback ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("ApplicationResource.getAccessToken");
+ if (logger.isTraceEnabled()) {
+ logger.trace("ApplicationResource.getAccessToken");
}
User user = null;
@@ -273,7 +273,7 @@ public class ApplicationResource extends ServiceResource {
if ( user == null ) {
if (logger.isDebugEnabled()) {
- logger.debug("Returning 400 bad request due to: " + errorDescription);
+ logger.debug("Returning 400 bad request due to: {}", errorDescription);
}
OAuthResponse response =
@@ -313,8 +313,8 @@ public class ApplicationResource extends ServiceResource {
@FormParam("redirect_uri") String redirect_uri,
@QueryParam("callback") @DefaultValue("") String callback ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("ApplicationResource.getAccessTokenPost");
+ if (logger.isTraceEnabled()) {
+ logger.trace("ApplicationResource.getAccessTokenPost");
}
return getAccessToken( ui, authorization, grant_type, username, password, pin, client_id, client_secret, code,
@@ -363,8 +363,8 @@ public class ApplicationResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("AuthResource.keys");
+ if (logger.isTraceEnabled()) {
+ logger.trace("AuthResource.keys");
}
if ( !isApplicationAdmin( Identifier.fromUUID( applicationId ) ) ) {
@@ -387,8 +387,8 @@ public class ApplicationResource extends ServiceResource {
public ApiResponse generateKeys( @Context UriInfo ui,
@QueryParam("callback") @DefaultValue("callback") String callback ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("AuthResource.keys");
+ if (logger.isTraceEnabled()) {
+ logger.trace("AuthResource.keys");
}
if ( !isApplicationAdmin( Identifier.fromUUID( applicationId ) ) ) {
@@ -451,8 +451,8 @@ public class ApplicationResource extends ServiceResource {
@FormParam("username") String username,
@FormParam("password") String password ) {
- if (logger.isDebugEnabled()) {
- logger.debug("ApplicationResource /authorize: {}/{}", username, password);
+ if (logger.isTraceEnabled()) {
+ logger.trace("ApplicationResource /authorize: {}/{}", username, password);
}
try {
@@ -564,8 +564,8 @@ public class ApplicationResource extends ServiceResource {
Class cls = Class.forName( "org.apache.usergrid.rest.applications.notifiers.NotifiersResource" );
- if (logger.isDebugEnabled()) {
- logger.debug("NotifiersResource.getNotifiersResource");
+ if (logger.isTraceEnabled()) {
+ logger.trace("NotifiersResource.getNotifiersResource");
}
addParameter( getServiceParameters(), "notifiers" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/AuthResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/AuthResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/AuthResource.java
index d90a44c..e5464de 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/AuthResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/AuthResource.java
@@ -94,7 +94,9 @@ public class AuthResource extends AbstractContextResource {
@QueryParam("ttl") long ttl, @QueryParam("callback") @DefaultValue("") String callback )
throws Exception {
- logger.info( "AuthResource.authFBPost" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("AuthResource.authFBPost");
+ }
return authFB( ui, fb_access_token, ttl, callback );
}
@@ -105,7 +107,9 @@ public class AuthResource extends AbstractContextResource {
@Path("pingident")
public Response authPingIdent( @Context UriInfo ui, @QueryParam("ping_access_token") String pingToken,
@QueryParam("callback") @DefaultValue("") String callback ) throws Exception {
- logger.info( "AuthResource.pingIdent" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("AuthResource.pingIdent");
+ }
try {
if ( StringUtils.isEmpty( pingToken ) ) {
missingTokenFail( callback );
@@ -178,7 +182,9 @@ public class AuthResource extends AbstractContextResource {
@QueryParam("ttl") long ttl, @QueryParam("callback") @DefaultValue("") String callback )
throws Exception {
- logger.info( "AuthResource.authFB" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("AuthResource.authFB");
+ }
try {
if ( StringUtils.isEmpty( fb_access_token ) ) {
@@ -214,7 +220,9 @@ public class AuthResource extends AbstractContextResource {
@QueryParam("ttl") long ttl, @QueryParam("callback") @DefaultValue("") String callback )
throws Exception {
- logger.info( "AuthResource.authFQPost" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("AuthResource.authFQPost");
+ }
return authFQ( ui, fq_access_token, ttl, callback );
}
@@ -227,7 +235,9 @@ public class AuthResource extends AbstractContextResource {
@QueryParam("ttl") long ttl, @QueryParam("callback") @DefaultValue("") String callback )
throws Exception {
- logger.info( "AuthResource.authFQ" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("AuthResource.authFQ");
+ }
try {
if ( StringUtils.isEmpty( fq_access_token ) ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
index 70adf35..78d0e2a 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
@@ -183,8 +183,8 @@ public class ServiceResource extends AbstractContextResource {
@Path("file")
public AbstractContextResource getFileResource( @Context UriInfo ui ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.getFileResource" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.getFileResource" );
}
ServiceParameter.addParameter( getServiceParameters(), "assets" );
@@ -202,8 +202,8 @@ public class ServiceResource extends AbstractContextResource {
public AbstractContextResource addIdParameter( @Context UriInfo ui, @PathParam("entityId") PathSegment entityId )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.addIdParameter" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.addIdParameter" );
}
UUID itemId = UUID.fromString( entityId.getPath() );
@@ -219,9 +219,9 @@ public class ServiceResource extends AbstractContextResource {
@Path("{itemName}")
public AbstractContextResource addNameParameter( @Context UriInfo ui, @PathParam("itemName") PathSegment itemName )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.addNameParameter" );
- logger.debug( "Current segment is {}", itemName.getPath() );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.addNameParameter" );
+ logger.trace( "Current segment is {}", itemName.getPath() );
}
@@ -243,8 +243,8 @@ public class ServiceResource extends AbstractContextResource {
public ServiceResults executeServiceRequest( UriInfo ui, ApiResponse response, ServiceAction action,
ServicePayload payload ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executeServiceRequest" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executeServiceRequest" );
}
@@ -334,8 +334,8 @@ public class ServiceResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executeGet" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executeGet" );
}
ApiResponse response = createApiResponse();
@@ -385,8 +385,8 @@ public class ServiceResource extends AbstractContextResource {
public ApiResponse executePostWithObject( @Context UriInfo ui, Object json,
@QueryParam("callback") @DefaultValue("callback") String callback ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executePostWithMap" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executePostWithMap" );
}
ApiResponse response = createApiResponse();
@@ -434,8 +434,8 @@ public class ServiceResource extends AbstractContextResource {
public ApiResponse executePost( @Context UriInfo ui, String body,
@QueryParam("callback") @DefaultValue("callback") String callback ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executePost: body = " + body );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executePost: body = {}", body );
}
Object json;
@@ -470,8 +470,8 @@ public class ServiceResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executePut" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executePut" );
}
ObjectMapper mapper = new ObjectMapper();
@@ -491,8 +491,8 @@ public class ServiceResource extends AbstractContextResource {
@QueryParam("app_delete_confirm") String confirmAppDelete )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executeDelete" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executeDelete" );
}
ApiResponse response = createApiResponse();
@@ -610,8 +610,8 @@ public class ServiceResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback,
FormDataMultiPart multiPart ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executeMultiPartPost" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executeMultiPartPost" );
}
return executeMultiPart( ui, callback, multiPart, ServiceAction.POST );
}
@@ -626,8 +626,8 @@ public class ServiceResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback,
FormDataMultiPart multiPart ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executeMultiPartPut" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executeMultiPartPut" );
}
return executeMultiPart( ui, callback, multiPart, ServiceAction.PUT );
}
@@ -655,7 +655,9 @@ public class ServiceResource extends AbstractContextResource {
data.put( bodyPart.getName(), bodyPart.getValue() );
}
else {
- logger.info( "skipping bodyPart {} of media type {}", bodyPart.getName(), bodyPart.getMediaType() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("skipping bodyPart {} of media type {}", bodyPart.getName(), bodyPart.getMediaType());
+ }
}
}
@@ -754,8 +756,8 @@ public class ServiceResource extends AbstractContextResource {
@HeaderParam("range") String rangeHeader,
@HeaderParam("if-modified-since") String modifiedSince ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "ServiceResource.executeStreamGet" );
+ if(logger.isTraceEnabled()){
+ logger.trace( "ServiceResource.executeStreamGet" );
}
//Needed for testing
@@ -773,9 +775,9 @@ public class ServiceResource extends AbstractContextResource {
ServiceResults serviceResults = executeServiceRequest( ui, response, ServiceAction.GET, null );
Entity entity = serviceResults.getEntity();
- if(logger.isDebugEnabled()){
- logger.debug( "In ServiceResource.executeStreamGet with id: {}, range: {}, modifiedSince: {}",
- new Object[] { entityId, rangeHeader, modifiedSince } );
+ if(logger.isTraceEnabled()){
+ logger.trace( "In ServiceResource.executeStreamGet with id: {}, range: {}, modifiedSince: {}",
+ entityId, rangeHeader, modifiedSince );
}
Map<String, Object> fileMetadata = AssetUtils.getFileMetadata( entity );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/assets/AssetsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/assets/AssetsResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/assets/AssetsResource.java
index 6eb6307..b894205 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/assets/AssetsResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/assets/AssetsResource.java
@@ -71,9 +71,13 @@ public class AssetsResource extends ServiceResource {
@Path("{itemName}")
public AbstractContextResource addNameParameter( @Context UriInfo ui, @PathParam("itemName") PathSegment itemName )
throws Exception {
- logger.info( "in AssetsResource.addNameParameter" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("in AssetsResource.addNameParameter");
+ }
super.addNameParameter( ui, itemName );
- logger.info( "serviceParamters now has: {}", getServiceParameters() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("serviceParamters now has: {}", getServiceParameters());
+ }
// HTF to work w/ the ../data endpoint when we are looking up by path?
return getSubResource( AssetsResource.class );
}
@@ -87,7 +91,9 @@ public class AssetsResource extends ServiceResource {
public ApiResponse executeGet( @Context UriInfo ui,
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "In AssetsResource.executeGet with ui: {} and callback: {}", ui, callback );
+ if (logger.isTraceEnabled()) {
+ logger.trace("In AssetsResource.executeGet with ui: {} and callback: {}", ui, callback);
+ }
return super.executeGet( ui, callback );
}
@@ -164,12 +170,16 @@ public class AssetsResource extends ServiceResource {
}
UUID assetId = UUID.fromString( entityId.getPath() );
- logger.info( "In AssetsResource.uploadDataStream with id: {}", assetId );
+ if (logger.isTraceEnabled()) {
+ logger.trace("In AssetsResource.uploadDataStream with id: {}", assetId);
+ }
EntityManager em = emf.getEntityManager( getApplicationId() );
Asset asset = em.get( assetId, Asset.class );
binaryStore.write( getApplicationId(), asset, uploadedInputStream );
- logger.info( "uploadDataStream written, returning response" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("uploadDataStream written, returning response");
+ }
em.update( asset );
return Response.status( 200 ).build();
}
@@ -189,8 +199,10 @@ public class AssetsResource extends ServiceResource {
}
UUID assetId = UUID.fromString( entityId.getPath() );
- logger.info( "In AssetsResource.findAsset with id: {}, range: {}, modifiedSince: {}",
- new Object[] { assetId, range, modifiedSince } );
+ if (logger.isTraceEnabled()) {
+ logger.trace("In AssetsResource.findAsset with id: {}, range: {}, modifiedSince: {}",
+ assetId, range, modifiedSince);
+ }
EntityManager em = emf.getEntityManager( getApplicationId() );
Asset asset = em.get( assetId, Asset.class );
@@ -217,7 +229,9 @@ public class AssetsResource extends ServiceResource {
return Response.status( Response.Status.NOT_FOUND ).build();
}
- logger.info( "AssetResource.findAsset read inputStream, composing response" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("AssetResource.findAsset read inputStream, composing response");
+ }
Response.ResponseBuilder responseBuilder =
Response.ok( is ).type( fileMetadata.get( "content-type" ).toString() )
.lastModified( new Date( asset.getModified() ) );
@@ -225,7 +239,9 @@ public class AssetsResource extends ServiceResource {
responseBuilder.tag( ( String ) fileMetadata.get( AssetUtils.E_TAG ) );
}
if ( StringUtils.isNotBlank( range ) ) {
- logger.info( "Range header was not blank, sending back Content-Range" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Range header was not blank, sending back Content-Range");
+ }
// TODO build content range header if needed
//responseBuilder.header("Content-Range", );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifierResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifierResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifierResource.java
index 4e4a3b1..2049983 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifierResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifierResource.java
@@ -65,8 +65,8 @@ public class NotifierResource extends ServiceResource {
@QueryParam("callback") @DefaultValue("callback") String callback,
FormDataMultiPart multiPart) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("NotifierResource.executeMultiPartPut");
+ if (logger.isTraceEnabled()) {
+ logger.trace("NotifierResource.executeMultiPartPut");
}
String certInfoParam = getValueOrNull(multiPart, "certInfo");
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifiersResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifiersResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifiersResource.java
index 53b29b4..b92e775 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifiersResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/notifiers/NotifiersResource.java
@@ -56,8 +56,8 @@ public class NotifiersResource extends ServiceResource {
public AbstractContextResource addIdParameter(@Context UriInfo ui,
@PathParam("entityId") PathSegment entityId) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("NotifiersResource.addIdParameter");
+ if (logger.isTraceEnabled()) {
+ logger.trace("NotifiersResource.addIdParameter");
}
UUID itemId = UUID.fromString(entityId.getPath());
@@ -74,9 +74,9 @@ public class NotifiersResource extends ServiceResource {
public AbstractContextResource addNameParameter(@Context UriInfo ui,
@PathParam("itemName") PathSegment itemName) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("NotifiersResource.addNameParameter");
- logger.debug("Current segment is " + itemName.getPath());
+ if (logger.isTraceEnabled()) {
+ logger.trace("NotifiersResource.addNameParameter");
+ logger.trace("Current segment is {}", itemName.getPath());
}
if (itemName.getPath().startsWith("{")) {
@@ -113,8 +113,8 @@ public class NotifiersResource extends ServiceResource {
FormDataMultiPart multiPart)
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("Notifiers.executeMultiPartPost");
+ if (logger.isTraceEnabled()) {
+ logger.trace("Notifiers.executeMultiPartPost");
}
String certInfoParam = getValueOrNull(multiPart, "certInfo");
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueResource.java
index 609b860..ac177aa 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueResource.java
@@ -65,7 +65,9 @@ public class QueueResource extends AbstractContextResource {
@Path("{subPath}")
public QueueResource getSubPath( @Context UriInfo ui, @PathParam("subPath") String subPath ) throws Exception {
- logger.info( "QueueResource.getSubPath" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.getSubPath");
+ }
return getSubResource( QueueResource.class ).init( mq, queuePath + "/" + subPath );
}
@@ -75,7 +77,9 @@ public class QueueResource extends AbstractContextResource {
@Path("subscribers")
public QueueSubscriberResource getSubscribers( @Context UriInfo ui ) throws Exception {
- logger.info( "QueueResource.getSubscribers" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.getSubscribers");
+ }
return getSubResource( QueueSubscriberResource.class ).init( mq, queuePath );
}
@@ -85,7 +89,9 @@ public class QueueResource extends AbstractContextResource {
@Path("subscriptions")
public QueueSubscriptionResource getSubscriptions( @Context UriInfo ui ) throws Exception {
- logger.info( "QueueResource.getSubscriptions" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.getSubscriptions");
+ }
return getSubResource( QueueSubscriptionResource.class ).init( mq, queuePath );
}
@@ -100,7 +106,9 @@ public class QueueResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueResource.getProperties" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.getProperties");
+ }
return mq.getQueue( queuePath );
}
@@ -116,7 +124,9 @@ public class QueueResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueResource.putProperties" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.putProperties");
+ }
return mq.updateQueue( queuePath, json );
}
@@ -132,14 +142,18 @@ public class QueueResource extends AbstractContextResource {
throws Exception {
if ( StringUtils.isNotBlank( queuePath ) ) {
- logger.info( "QueueResource.executeGet: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.executeGet: {}", queuePath);
+ }
QueueQuery query = QueueQuery.fromQueryParams( ui.getQueryParameters() );
QueueResults results = mq.getFromQueue( queuePath, query );
return results;
}
- logger.info( "QueueResource.executeGet" );
+ if (logger.isTraceEnabled()) {
+ logger.trace( "QueueResource.executeGet" );
+ }
return mq.getQueues( firstQueuePath, limit );
}
@@ -155,7 +169,9 @@ public class QueueResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueResource.executePost: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.executePost: {}", queuePath);
+ }
Object json = body;
if ( json instanceof Map ) {
@@ -178,7 +194,9 @@ public class QueueResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueResource.executePut: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.executePut: {}", queuePath);
+ }
Map<String, Object> results = new HashMap<String, Object>();
@@ -200,7 +218,9 @@ public class QueueResource extends AbstractContextResource {
@Path("transactions")
public QueueTransactionsResource getTransactions( @Context UriInfo ui ) throws Exception {
- logger.info( "QueueResource.getSubscriptions" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueResource.getSubscriptions");
+ }
return getSubResource( QueueTransactionsResource.class ).init( mq, queuePath );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriberResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriberResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriberResource.java
index b264e8f..54cc8ab 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriberResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriberResource.java
@@ -74,7 +74,9 @@ public class QueueSubscriberResource extends AbstractContextResource {
public QueueSubscriberResource getSubPath( @Context UriInfo ui, @PathParam("subPath") String subPath )
throws Exception {
- logger.info( "QueueSubscriberResource.getSubPath" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriberResource.getSubPath");
+ }
return getSubResource( QueueSubscriberResource.class ).init( mq, queuePath, subscriberPath + "/" + subPath );
}
@@ -89,7 +91,9 @@ public class QueueSubscriberResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueSubscriberResource.executeGet: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriberResource.executeGet: {}", queuePath);
+ }
QueueSet results = mq.getSubscribers( queuePath, firstSubscriberQueuePath, limit );
@@ -106,7 +110,9 @@ public class QueueSubscriberResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueSubscriberResource.executePost: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriberResource.executePost: {}", queuePath);
+ }
return executePut( ui, body, callback );
}
@@ -121,7 +127,9 @@ public class QueueSubscriberResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueSubscriberResource.executePut: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriberResource.executePut: {}", queuePath);
+ }
Map<String, Object> json = body;
if ( StringUtils.isNotBlank( subscriberPath ) ) {
@@ -148,7 +156,9 @@ public class QueueSubscriberResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueSubscriberResource.executeDelete: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriberResource.executeDelete: {}", queuePath);
+ }
if ( StringUtils.isNotBlank( subscriberPath ) ) {
return mq.unsubscribeFromQueue( queuePath, subscriberPath );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriptionResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriptionResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriptionResource.java
index 778b57d..acc13a3 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriptionResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/queues/QueueSubscriptionResource.java
@@ -75,7 +75,9 @@ public class QueueSubscriptionResource extends AbstractContextResource {
public QueueSubscriptionResource getSubPath( @Context UriInfo ui, @PathParam("subPath") String subPath )
throws Exception {
- logger.info( "QueueSubscriptionResource.getSubPath" );
+ if (logger.isTraceEnabled()) {
+ logger.info("QueueSubscriptionResource.getSubPath");
+ }
return getSubResource( QueueSubscriptionResource.class )
.init( mq, queuePath, subscriptionPath + "/" + subPath );
@@ -91,7 +93,9 @@ public class QueueSubscriptionResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueSubscriptionResource.executeGet: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriptionResource.executeGet: {}", queuePath);
+ }
QueueSet results = mq.getSubscriptions( queuePath, firstSubscriptionQueuePath, limit );
@@ -108,7 +112,9 @@ public class QueueSubscriptionResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueSubscriptionResource.executePost: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriptionResource.executePost: {}", queuePath);
+ }
return executePut( ui, body, callback );
}
@@ -123,7 +129,9 @@ public class QueueSubscriptionResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueSubscriptionResource.executePut: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriptionResource.executePut: {}", queuePath);
+ }
Map<String, Object> json = body;
if ( StringUtils.isNotBlank( subscriptionPath ) ) {
@@ -150,7 +158,9 @@ public class QueueSubscriptionResource extends AbstractContextResource {
@QueryParam("callback") @DefaultValue("callback") String callback )
throws Exception {
- logger.info( "QueueSubscriptionResource.executeDelete: " + queuePath );
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueSubscriptionResource.executeDelete: {}", queuePath);
+ }
if ( StringUtils.isNotBlank( subscriptionPath ) ) {
return mq.unsubscribeFromQueue( subscriptionPath, queuePath );
[3/7] usergrid git commit: USERGRID-1243: logging overhaul, pt. 1
Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 032836f..0e55dc9 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,15 +224,15 @@ public class CounterUtils {
UUID queueId, String category, String name, long value,
long counterTimestamp, long cassandraTimestamp ) {
for ( CounterResolution resolution : CounterResolution.values() ) {
- if (logger.isDebugEnabled()) {
- logger.debug("BIAC for resolution {}", resolution);
+ if (logger.isTraceEnabled()) {
+ logger.trace("BIAC for resolution {}", resolution);
}
batchIncrementAggregateCounters( m, userId, groupId, queueId, category, resolution, name, value,
counterTimestamp, applicationId );
- if (logger.isDebugEnabled()) {
- logger.debug("DONE BIAC for resolution {}", resolution);
+ if (logger.isTraceEnabled()) {
+ logger.trace("DONE BIAC for resolution {}", resolution);
}
}
batchIncrementEntityCounter( m, applicationId, name, value, cassandraTimestamp, applicationId );
@@ -296,9 +296,9 @@ public class CounterUtils {
private void handleAggregateCounterRow( Mutator<ByteBuffer> m, String key, long column, long value,
UUID applicationId ) {
- if ( logger.isDebugEnabled() ) {
- logger.info( "HACR: aggregateRow for app {} with key {} column {} and value {}",
- new Object[] { applicationId, key, column, value } );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "HACR: aggregateRow for app {} with key {} column {} and value {}",
+ applicationId, key, column, value );
}
if ( "o".equals( counterType ) || "p".equals( counterType ) ) {
if ( m != null ) {
@@ -340,9 +340,9 @@ public class CounterUtils {
private Mutator<ByteBuffer> batchIncrementEntityCounter( Mutator<ByteBuffer> m, UUID entityId, String name,
Long value, long timestamp, UUID applicationId ) {
- if ( logger.isDebugEnabled() ) {
- logger.debug( "BIEC: Incrementing property {} of entity {} by value {}",
- new Object[] { name, entityId, value } );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "BIEC: Incrementing property {} of entity {} by value {}",
+ name, entityId, value );
}
addInsertToMutator( m, ENTITY_DICTIONARIES, key( entityId, DICTIONARY_COUNTERS ), name, null, timestamp );
if ( "o".equals( counterType ) || "p".equals( counterType ) ) {
@@ -359,9 +359,9 @@ public class CounterUtils {
public Mutator<ByteBuffer> batchIncrementQueueCounter( Mutator<ByteBuffer> m, UUID queueId, String name, long value,
long timestamp, UUID applicationId ) {
- if ( logger.isDebugEnabled() ) {
- logger.debug( "BIQC: Incrementing property {} of queue {} by value {}",
- new Object[] { name, queueId, value } );
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "BIQC: Incrementing property {} of queue {} by value {}",
+ name, queueId, value );
}
m.addInsertion( bytebuffer( key( queueId, DICTIONARY_COUNTERS ).toString() ),
QueuesCF.QUEUE_DICTIONARIES.toString(),
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
index ad60b1c..2efbb62 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/Setup.java
@@ -18,10 +18,6 @@ package org.apache.usergrid.persistence.cassandra;
import java.util.UUID;
-/**
- *
- * @author ApigeeCorporation
- */
public interface Setup {
/**
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/Slf4jTraceTagReporter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/Slf4jTraceTagReporter.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/Slf4jTraceTagReporter.java
index a94f097..e137cec 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/Slf4jTraceTagReporter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/util/Slf4jTraceTagReporter.java
@@ -47,10 +47,10 @@ public class Slf4jTraceTagReporter implements TraceTagReporter {
public void report( TraceTag traceTag ) {
logger.info( "TraceTag: {}", traceTag.getTraceName() );
for ( TimedOpTag timedOpTag : traceTag ) {
- logger.info( "----opId: {} opName: {} startTime: {} elapsed: {}", new Object[] {
+ logger.info( "----opId: {} opName: {} startTime: {} elapsed: {}",
timedOpTag.getOpTag(), timedOpTag.getTagName(), new Date( timedOpTag.getStart() ),
timedOpTag.getElapsed()
- } );
+ );
}
logger.info( "------" );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 5825ee0..f9aa70e 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
@@ -39,8 +39,8 @@ public class TraceTagAspect {
public Object applyTrace( ProceedingJoinPoint pjp ) throws Throwable {
String tagName = pjp.toLongString();
- if (logger.isDebugEnabled()) {
- logger.debug("Applyng trace on {}", tagName);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Applying trace on {}", tagName);
}
TimedOpTag timedOpTag = traceTagManager.timerInstance();
@@ -56,8 +56,8 @@ public class TraceTagAspect {
timedOpTag.stopAndApply( tagName, success );
traceTagManager.addTimer( timedOpTag );
- if (logger.isDebugEnabled()) {
- logger.debug("TimedOpTag added in Aspect on {}", tagName);
+ if (logger.isTraceEnabled()) {
+ logger.trace("TimedOpTag added in Aspect on {}", tagName);
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 fe5cada..1a0756e 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,8 +146,8 @@ public class TraceTagManager {
public void attach( TraceTag traceTag ) {
Preconditions.checkState( !isActive(), "Attempt to attach on already active trace" );
localTraceTag.set( traceTag );
- if (logger.isDebugEnabled()) {
- logger.debug("Attached TraceTag {} to thread", traceTag);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Attached TraceTag {} to thread", traceTag);
}
}
@@ -157,8 +157,8 @@ public class TraceTagManager {
TraceTag traceTag = localTraceTag.get();
Preconditions.checkState( isActive(), "Attempt to detach on no active trace" );
localTraceTag.remove();
- if (logger.isDebugEnabled()) {
- logger.debug("Detached TraceTag {} from thread", traceTag);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Detached TraceTag {} from thread", traceTag);
}
return traceTag;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/system/UsergridSystemMonitor.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/system/UsergridSystemMonitor.java b/stack/core/src/main/java/org/apache/usergrid/system/UsergridSystemMonitor.java
index c56315e..87820f2 100644
--- a/stack/core/src/main/java/org/apache/usergrid/system/UsergridSystemMonitor.java
+++ b/stack/core/src/main/java/org/apache/usergrid/system/UsergridSystemMonitor.java
@@ -92,7 +92,7 @@ public class UsergridSystemMonitor {
* are in debug mode.
*/
public void maybeLogPayload( long duration, Object... objects ) {
- if ( duration > timerLogThreshold || logger.isDebugEnabled() ) {
+ if ( duration > timerLogThreshold || logger.isInfoEnabled() ) {
String message;
if ( objects.length > 1 ) {
message = formatMessage( duration, MapUtils.map( objects ) );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/utils/AESUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/AESUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/AESUtils.java
index 1a75d70..092b925 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/AESUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/AESUtils.java
@@ -32,7 +32,7 @@ import static org.apache.commons.lang.StringUtils.substring;
public class AESUtils {
- private static final Logger LOG = LoggerFactory.getLogger( AESUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( AESUtils.class );
private static byte[] linebreak = { };
private static Cipher cipher;
@@ -45,7 +45,7 @@ public class AESUtils {
coder = new Base64( 32, linebreak, true );
}
catch ( Throwable t ) {
- LOG.error( "Cipher error", t );
+ logger.error( "Cipher error", t );
}
}
@@ -59,7 +59,7 @@ public class AESUtils {
return new String( coder.encode( cipherText ) );
}
catch ( Exception e ) {
- LOG.error( "Encryption error", e );
+ logger.error( "Encryption error", e );
}
return null;
}
@@ -76,7 +76,7 @@ public class AESUtils {
return new String( decrypted );
}
catch ( Exception e ) {
- LOG.error( "Decryption error", e );
+ logger.error( "Decryption error", e );
}
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/utils/ConversionUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/ConversionUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/ConversionUtils.java
index 567a713..60bc64e 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/ConversionUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/ConversionUtils.java
@@ -643,7 +643,7 @@ public class ConversionUtils {
}
}
catch ( Exception e ) {
- logger.error( "Unable to get object from bytes for type " + type.getName(), e );
+ logger.error( "Unable to get object from bytes for type {}", type.getName(), e );
}
return null;
}
@@ -683,7 +683,7 @@ public class ConversionUtils {
}
}
catch ( Exception e ) {
- logger.error( "Unable to get object from bytes for type " + type.getName(), e );
+ logger.error( "Unable to get object from bytes for type {}", type.getName(), e );
}
return null;
}
@@ -748,7 +748,7 @@ public class ConversionUtils {
}
}
catch ( Exception e ) {
- logger.error( "Unable to get object from bytes for type " + type.getName(), e );
+ logger.error( "Unable to get object from bytes for type {}", type.getName(), e );
}
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/utils/IndexUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/IndexUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/IndexUtils.java
index 5fc0f74..a6ad93b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/IndexUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/IndexUtils.java
@@ -51,7 +51,7 @@ import static org.apache.usergrid.utils.JsonUtils.toJsonNode;
public class IndexUtils {
- private static final Logger LOG = LoggerFactory.getLogger( IndexUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( IndexUtils.class );
static Analyzer analyzer = new StandardAnalyzer( Version.LUCENE_30 );
@@ -215,7 +215,7 @@ public class IndexUtils {
ts.end();
}
catch ( IOException e ) {
- LOG.error( "Error getting keywords ", e );
+ logger.error( "Error getting keywords ", e );
}
finally {
try {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 4f1b54e..3bb96f9 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
@@ -47,7 +47,7 @@ import static org.apache.usergrid.utils.StringUtils.stringOrSubstringBeforeFirst
public class JsonUtils {
- private static final Logger LOG = LoggerFactory.getLogger( JsonUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( JsonUtils.class );
static ObjectMapper mapper = new ObjectMapper();
@@ -72,8 +72,8 @@ public class JsonUtils {
return mapper.writeValueAsString( obj );
}
catch ( Throwable t ) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Error generating JSON", t);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Error generating JSON", t);
}
throw new JsonWriteException( "Error generating JSON", t );
}
@@ -86,8 +86,8 @@ public class JsonUtils {
return indentObjectMapper.writeValueAsString( obj );
}
catch ( Throwable t ) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Error generating JSON", t);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Error generating JSON", t);
}
throw new JsonWriteException( "Error generating JSON", t );
}
@@ -100,8 +100,8 @@ public class JsonUtils {
return mapper.readValue( json, Object.class );
}
catch ( Throwable t ) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Error parsing JSON", t);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Error parsing JSON", t);
}
throw new JsonReadException( "Error parsing JSON", t );
}
@@ -124,7 +124,7 @@ public class JsonUtils {
bytes = smileMapper.writeValueAsBytes( obj );
}
catch ( Exception e ) {
- LOG.error( "Error getting SMILE bytes", e );
+ logger.error( "Error getting SMILE bytes", e );
}
if ( bytes != null ) {
return ByteBuffer.wrap( bytes );
@@ -152,7 +152,7 @@ public class JsonUtils {
byteBuffer.remaining(), clazz );
}
catch ( Exception e ) {
- LOG.error( "Error parsing SMILE bytes", e );
+ logger.error( "Error parsing SMILE bytes", e );
}
return obj;
}
@@ -184,7 +184,7 @@ public class JsonUtils {
return UUID.fromString( s );
}
catch ( IllegalArgumentException e ) {
- LOG.warn( "Argument to UUID.fromString({}) was invalid.", s, e );
+ logger.warn( "Argument to UUID.fromString({}) was invalid.", s, e );
}
}
}
@@ -333,7 +333,7 @@ public class JsonUtils {
json = mapper.readValue( file, Object.class );
}
catch ( Exception e ) {
- LOG.error( "Error loading JSON", e );
+ logger.error( "Error loading JSON", e );
}
return json;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/utils/ListUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/ListUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/ListUtils.java
index 6a88193..6b90389 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/ListUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/ListUtils.java
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
public class ListUtils extends org.apache.commons.collections.ListUtils {
- private static final Logger LOG = LoggerFactory.getLogger( ListUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( ListUtils.class );
public static <A> A first( List<A> list ) {
@@ -68,7 +68,7 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
return NumberUtils.toInt( ( String ) a );
}
catch ( Exception e ) {
- LOG.warn( "Could not convert list item {} to int", a, e );
+ logger.warn( "Could not convert list item {} to int", a, e );
}
return null;
}
@@ -88,7 +88,7 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
return NumberUtils.toLong( ( String ) a );
}
catch ( Exception e ) {
- LOG.warn( "Could not convert list item {} to long", a, e );
+ logger.warn( "Could not convert list item {} to long", a, e );
}
return null;
}
@@ -108,7 +108,7 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
return Boolean.parseBoolean( ( String ) a );
}
catch ( Exception e ) {
- LOG.warn( "Could not convert list item {} to boolean", a, e );
+ logger.warn( "Could not convert list item {} to boolean", a, e );
}
return null;
}
@@ -128,7 +128,7 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
return UUIDUtils.tryGetUUID( ( String ) i );
}
catch ( Exception e ) {
- LOG.warn( "Could not convert list item {} to UUID", i, e );
+ logger.warn( "Could not convert list item {} to UUID", i, e );
}
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java
index 5f64ef3..b91b866 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/StringUtils.java
@@ -29,7 +29,7 @@ import static org.apache.usergrid.utils.ConversionUtils.string;
public class StringUtils extends org.apache.commons.lang.StringUtils {
- private static final Logger LOG = LoggerFactory.getLogger( StringUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( StringUtils.class );
public static Object lower( Object obj ) {
@@ -165,7 +165,7 @@ public class StringUtils extends org.apache.commons.lang.StringUtils {
return IOUtils.toString( StringUtils.class.getResourceAsStream( filePath ) );
}
catch ( Exception e ) {
- LOG.error( "Error getting file from classpath: " + filePath, e );
+ logger.error( "Error getting file from classpath: {}", filePath, e );
}
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java b/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
index 22c304a..1f763b2 100644
--- a/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
+++ b/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
@@ -135,12 +135,11 @@ public class ScopedCacheSerializationImpl<K,V> implements ScopedCacheSerializati
V value = MAPPER.readValue(result.getByteArrayValue(), typeRef);
logger.debug("Read cache item from scope {}\n key/value types {}/{}\n key:value: {}:{}",
- new Object[]{
scope.getApplication().getUuid(),
key.getClass().getSimpleName(),
value.getClass().getSimpleName(),
key,
- value});
+ value);
return value;
@@ -196,12 +195,11 @@ public class ScopedCacheSerializationImpl<K,V> implements ScopedCacheSerializati
executeBatch(batch);
logger.debug("Wrote cache item to scope {}\n key/value types {}/{}\n key:value: {}:{}",
- new Object[] {
scope.getApplication().getUuid(),
key.getClass().getSimpleName(),
value.getClass().getSimpleName(),
key,
- value});
+ value);
return value;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
index a0d0c1a..460c271 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkCommit.java
@@ -53,7 +53,7 @@ import rx.functions.Action1;
@Singleton
public class MarkCommit implements Action1<CollectionIoEvent<MvccEntity>> {
- private static final Logger LOG = LoggerFactory.getLogger( MarkCommit.class );
+ private static final Logger logger = LoggerFactory.getLogger( MarkCommit.class );
private final MvccLogEntrySerializationStrategy logStrat;
private final MvccEntitySerializationStrategy entityStrat;
@@ -94,7 +94,7 @@ public class MarkCommit implements Action1<CollectionIoEvent<MvccEntity>> {
final ApplicationScope applicationScope = idIoEvent.getEntityCollection();
- LOG.debug("Inserting tombstone for entity {} at version {}", entityId, version );
+ logger.debug("Inserting tombstone for entity {} at version {}", entityId, version );
final MvccLogEntry startEntry =
new MvccLogEntryImpl( entityId, version, Stage.COMMITTED, MvccLogEntry.State.DELETED );
@@ -177,4 +177,4 @@ public class MarkCommit implements Action1<CollectionIoEvent<MvccEntity>> {
//
// final int removedCount = deleteFieldsObservable.count().toBlocking().last();
//
-// LOG.debug("Removed unique values for {} entities of entity {}", removedCount, entityId );
+// logger.debug("Removed unique values for {} entities of entity {}", removedCount, entityId );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java
index 3c4ea95..37b3b04 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStart.java
@@ -56,7 +56,7 @@ import rx.functions.Func1;
@Singleton
public class MarkStart implements Func1<CollectionIoEvent<Id>, CollectionIoEvent<MvccEntity>> {
- private static final Logger LOG = LoggerFactory.getLogger( MarkStart.class );
+ private static final Logger logger = LoggerFactory.getLogger( MarkStart.class );
private final MvccLogEntrySerializationStrategy logStrategy;
@@ -98,7 +98,7 @@ public class MarkStart implements Func1<CollectionIoEvent<Id>, CollectionIoEvent
write.execute();
}
catch ( ConnectionException e ) {
- LOG.error( "Failed to execute write asynchronously ", e );
+ logger.error( "Failed to execute write asynchronously ", e );
throw new CollectionRuntimeException( null, applicationScope,
"Failed to execute write asynchronously ", e );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/VersionCompact.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/VersionCompact.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/VersionCompact.java
index 5554a5f..c9d11be 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/VersionCompact.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/VersionCompact.java
@@ -91,7 +91,7 @@ public class VersionCompact
if ( logger.isDebugEnabled() ) {
logger.debug(
"Deleting log entry and version data for entity id {} and version {} in app scope {}",
- new Object[] { entityId, version, scope } );
+ entityId, version, scope );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java
index 8342e55..23c6dfe 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/RollbackAction.java
@@ -47,7 +47,7 @@ import rx.schedulers.Schedulers;
*/
public class RollbackAction implements Action1<Throwable> {
- private static final Logger log = LoggerFactory.getLogger( RollbackAction.class );
+ private static final Logger logger = LoggerFactory.getLogger( RollbackAction.class );
private final UniqueValueSerializationStrategy uniqueValueStrat;
private final MvccLogEntrySerializationStrategy logEntryStrat;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
index 21570ec..7eb96e7 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
@@ -58,7 +58,7 @@ import rx.functions.Func1;
@Singleton
public class WriteCommit implements Func1<CollectionIoEvent<MvccEntity>, CollectionIoEvent<MvccEntity>> {
- private static final Logger LOG = LoggerFactory.getLogger( WriteCommit.class );
+ private static final Logger logger = LoggerFactory.getLogger( WriteCommit.class );
@Inject
private UniqueValueSerializationStrategy uniqueValueStrat;
@@ -119,7 +119,7 @@ public class WriteCommit implements Func1<CollectionIoEvent<MvccEntity>, Collect
MutationBatch mb = uniqueValueStrat.write(applicationScope, written );
- LOG.debug("Finalizing {} unqiue value {}", field.getName(), field.getValue().toString());
+ logger.debug("Finalizing {} unique value {}", field.getName(), field.getValue().toString());
// merge into our existing mutation batch
logMutation.mergeShallow( mb );
@@ -129,7 +129,7 @@ public class WriteCommit implements Func1<CollectionIoEvent<MvccEntity>, Collect
logMutation.execute();
}
catch ( ConnectionException e ) {
- LOG.error( "Failed to execute write asynchronously ", e );
+ logger.error( "Failed to execute write asynchronously ", e );
throw new WriteCommitException( mvccEntity, applicationScope,
"Failed to execute write asynchronously ", e );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java
index 4ced629..6a69038 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerify.java
@@ -45,7 +45,7 @@ import rx.functions.Action1;
@Singleton
public class WriteOptimisticVerify implements Action1<CollectionIoEvent<MvccEntity>> {
- private static final Logger log = LoggerFactory.getLogger( WriteOptimisticVerify.class );
+ private static final Logger logger = LoggerFactory.getLogger( WriteOptimisticVerify.class );
private final MvccLogEntrySerializationStrategy logEntryStrat;
@@ -81,7 +81,7 @@ public class WriteOptimisticVerify implements Action1<CollectionIoEvent<MvccEnti
// Previous log entry must be committed, otherwise somebody is already writing
if ( versions.size() > 1 && versions.get( 1 ).getStage().ordinal() < Stage.COMMITTED.ordinal() ) {
- log.debug( "Conflict writing entity id {} version {}", entity.getId().toString(),
+ logger.debug( "Conflict writing entity id {} version {}", entity.getId().toString(),
entity.getVersion().toString() );
throw new WriteOptimisticVerifyException( mvccEntity, applicationScope,
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java
index 79b2d85..5de885e 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStart.java
@@ -36,7 +36,7 @@ import static org.apache.usergrid.persistence.core.util.ValidationUtils.verifyEn
@Singleton
public class WriteStart implements Func1<CollectionIoEvent<Entity>, CollectionIoEvent<MvccEntity>> {
- private static final Logger LOG = LoggerFactory.getLogger( WriteStart.class );
+ private static final Logger logger = LoggerFactory.getLogger( WriteStart.class );
private final MvccLogEntrySerializationStrategy logStrategy;
@@ -75,11 +75,11 @@ public class WriteStart implements Func1<CollectionIoEvent<Entity>, CollectionIo
try {
write.execute();
} catch (ConnectionException e) {
- LOG.error("Failed to execute write ", e);
+ logger.error("Failed to execute write ", e);
throw new WriteStartException(nextStage, applicationScope,
"Failed to execute write ", e);
} catch (NullPointerException e) {
- LOG.error("Failed to execute write ", e);
+ logger.error("Failed to execute write ", e);
throw new WriteStartException(nextStage, applicationScope,
"Failed to execute write", e);
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
index 564d036..780b83b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
@@ -62,7 +62,7 @@ import rx.functions.Action1;
@Singleton
public class WriteUniqueVerify implements Action1<CollectionIoEvent<MvccEntity>> {
- private static final Logger LOG = LoggerFactory.getLogger( WriteUniqueVerify.class );
+ private static final Logger logger = LoggerFactory.getLogger( WriteUniqueVerify.class );
private final UniqueValueSerializationStrategy uniqueValueStrat;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
index d5db5c9..57199e2 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
@@ -75,7 +75,7 @@ import rx.schedulers.Schedulers;
*/
public abstract class MvccEntitySerializationStrategyImpl implements MvccEntitySerializationStrategy {
- private static final Logger log = LoggerFactory.getLogger( MvccLogEntrySerializationStrategyImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( MvccLogEntrySerializationStrategyImpl.class );
protected final Keyspace keyspace;
@@ -419,9 +419,9 @@ public abstract class MvccEntitySerializationStrategyImpl implements MvccEntityS
deSerialized = column.getValue( entityJsonSerializer );
}
catch ( DataCorruptionException e ) {
- log.error(
- "DATA CORRUPTION DETECTED when de-serializing entity with Id {} and version {}. This means the"
- + " write was truncated.", id, version, e );
+ logger.error(
+ "DATA CORRUPTION DETECTED when de-serializing entity with Id {} and version {}. This means the write was truncated.",
+ id, version, e );
//return an empty entity, we can never load this one, and we don't want it to bring the system
//to a grinding halt
return new MvccEntityImpl( id, version, MvccEntity.Status.DELETED, Optional.<Entity>absent(),0 );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImpl.java
index 7ba6a5e..f28fa26 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImpl.java
@@ -60,7 +60,7 @@ import com.netflix.astyanax.serializers.AbstractSerializer;
*/
public abstract class MvccLogEntrySerializationStrategyImpl<K> implements MvccLogEntrySerializationStrategy {
- private static final Logger LOG = LoggerFactory.getLogger( MvccLogEntrySerializationStrategyImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( MvccLogEntrySerializationStrategyImpl.class );
private static final StageSerializer SER = new StageSerializer();
@@ -277,7 +277,9 @@ public abstract class MvccLogEntrySerializationStrategyImpl<K> implements MvccLo
final long timestamp = version.timestamp();
- LOG.debug( "Writing version with timestamp '{}'", timestamp );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Writing version with timestamp '{}'", timestamp);
+ }
final Id applicationId = collectionScope.getApplication();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
index 781490d..622ebef 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
@@ -225,12 +225,11 @@ public abstract class UniqueValueSerializationStrategyImpl<FieldKey, EntityKey>
ScopedRowKey.fromKey( applicationId, entityKey ) ) );
- if ( log.isDebugEnabled() ) {
- log.debug( "Writing unique value version={} name={} value={} ",
- new Object[] {
+ if ( log.isTraceEnabled() ) {
+ log.trace( "Writing unique value version={} name={} value={} ",
uniqueValue.getEntityVersion(), uniqueValue.getField().getName(),
uniqueValue.getField().getValue()
- } );
+ );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
index 5143c49..a110ed7 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationImpl.java
@@ -68,7 +68,7 @@ import rx.schedulers.Schedulers;
public class MvccEntityDataMigrationImpl implements DataMigration{
- private static final Logger LOGGER = LoggerFactory.getLogger( MvccEntityDataMigrationImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( MvccEntityDataMigrationImpl.class );
private final Keyspace keyspace;
private final VersionedMigrationSet<MvccEntitySerializationStrategy> allVersions;
@@ -149,7 +149,7 @@ public class MvccEntityDataMigrationImpl implements DataMigration{
new EntityToSaveMessage(currentScope, allVersions.next());
subscriber.onNext(message);
}catch (Exception e){
- LOGGER.error("Failed to load entity " +entityIdScope.getId(),e);
+ logger.error("Failed to load entity {}", entityIdScope.getId(),e);
}
}
@@ -224,7 +224,7 @@ public class MvccEntityDataMigrationImpl implements DataMigration{
totalBatch.mergeShallow(mb);
}
}catch (Exception e){
- LOGGER.error("Failed to migrate entity "+ message.entity.getId().getUuid()+ " :: " + message.entity.getId().getType(),e);
+ logger.error("Failed to migrate entity {} :: {}", message.entity.getId().getUuid(), message.entity.getId().getType(),e);
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 8c12a25..c24940b 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
@@ -51,7 +51,7 @@ import rx.schedulers.Schedulers;
public class MultiKeyColumnNameIterator<C, T> implements Iterable<T>, Iterator<T> {
- private static final Logger LOG = LoggerFactory.getLogger( MultiKeyColumnNameIterator.class );
+ private static final Logger logger = LoggerFactory.getLogger( MultiKeyColumnNameIterator.class );
private Iterator<T> iterator;
@@ -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 {
- if (LOG.isTraceEnabled()) LOG.trace( "Received element {}" , t );
+ if (logger.isTraceEnabled()) logger.trace( "Received element {}" , t );
queue.put( t );
}
catch ( InterruptedException e ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/executor/TaskExecutorFactory.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/executor/TaskExecutorFactory.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/executor/TaskExecutorFactory.java
index 4ffabf7..5e7761c 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/executor/TaskExecutorFactory.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/executor/TaskExecutorFactory.java
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
*/
public class TaskExecutorFactory {
- private static final Logger log = LoggerFactory.getLogger( TaskExecutorFactory.class );
+ private static final Logger logger = LoggerFactory.getLogger( TaskExecutorFactory.class );
public enum RejectionAction {
@@ -168,7 +168,7 @@ public class TaskExecutorFactory {
@Override
public void rejectedExecution( final Runnable r, final ThreadPoolExecutor executor ) {
- log.warn( "{} task queue full, rejecting task {} and running in thread {}", poolName, r,
+ logger.warn( "{} task queue full, rejecting task {} and running in thread {}", poolName, r,
Thread.currentThread().getName() );
//We've decided we want to have a "caller runs" policy, to just invoke the task when rejected
@@ -191,7 +191,7 @@ public class TaskExecutorFactory {
@Override
public void rejectedExecution( final Runnable r, final ThreadPoolExecutor executor ) {
- log.warn( "{} task queue full, dropping task {}", poolName, r );
+ logger.warn( "{} task queue full, dropping task {}", poolName, r );
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java
index 1b2dfdb..51afc59 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/metrics/MetricsFactoryImpl.java
@@ -18,7 +18,6 @@ package org.apache.usergrid.persistence.core.metrics;
import java.net.InetSocketAddress;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
@@ -29,7 +28,6 @@ import com.codahale.metrics.Gauge;
import com.codahale.metrics.Histogram;
import com.codahale.metrics.JmxReporter;
import com.codahale.metrics.Meter;
-import com.codahale.metrics.Metric;
import com.codahale.metrics.MetricFilter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
@@ -49,7 +47,7 @@ public class MetricsFactoryImpl implements MetricsFactory {
private MetricRegistry registry;
private GraphiteReporter graphiteReporter;
private JmxReporter jmxReporter;
- private static final Logger LOG = LoggerFactory.getLogger(MetricsFactoryImpl.class);
+ private static final Logger logger = LoggerFactory.getLogger(MetricsFactoryImpl.class);
@Inject
@@ -64,7 +62,7 @@ public class MetricsFactoryImpl implements MetricsFactory {
.build(graphite);
graphiteReporter.start(30, TimeUnit.SECONDS);
} else {
- LOG.warn("MetricsService:Logger not started.");
+ logger.warn("MetricsService:Logger not started.");
}
jmxReporter = JmxReporter.forRegistry(registry).build();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
index 4075437..db694fe 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
@@ -81,9 +81,8 @@ public class MigrationManagerImpl implements MigrationManager {
if ( columnFamilies == null || columnFamilies.size() == 0 ) {
logger.warn(
- "Class {} implements {} but returns null column families for migration. Either implement"
- + " this method or remove the interface from the class", migration.getClass(),
- Migration.class );
+ "Class {} implements {} but returns null column families for migration. Either implement this method or remove the interface from the class",
+ migration.getClass(), Migration.class );
continue;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 81cc973..bad2b69 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
@@ -37,7 +37,7 @@ import rx.Subscriber;
*/
public abstract class ObservableIterator<T> implements Observable.OnSubscribe<T> {
- private static final Logger log = LoggerFactory.getLogger( ObservableIterator.class );
+ private static final Logger logger = LoggerFactory.getLogger( ObservableIterator.class );
private final String name;
@@ -66,7 +66,7 @@ public abstract class ObservableIterator<T> implements Observable.OnSubscribe<T>
while ( itr.hasNext() && !subscriber.isUnsubscribed() ) {
final T next = itr.next();
- if (log.isTraceEnabled()) log.trace( "Iterator '{}' emitting item '{}'", name, next );
+ if (logger.isTraceEnabled()) logger.trace( "Iterator '{}' emitting item '{}'", name, next );
subscriber.onNext( next );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 1c33f58..38f7d8e 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
@@ -50,7 +50,7 @@ import rx.subscriptions.CompositeSubscription;
*/
public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
- private static final Logger log = LoggerFactory.getLogger( OrderedMerge.class );
+ private static final Logger logger = LoggerFactory.getLogger( OrderedMerge.class );
//the comparator to compare items
private final Comparator<T> comparator;
@@ -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() ) {
- if (log.isTraceEnabled()) log.trace( "Completing Observable. Draining elements from the subscribers", innerSubscribers.size() );
+ if (logger.isTraceEnabled()) logger.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();
- if (log.isTraceEnabled()) log.trace( "Emitting value {}", value );
+ if (logger.isTraceEnabled()) logger.trace( "Emitting value {}", value );
subscriber.onNext( value );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/GraphManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/GraphManagerImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/GraphManagerImpl.java
index 93ae753..e865377 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/GraphManagerImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/GraphManagerImpl.java
@@ -66,7 +66,7 @@ import rx.Observable;
*/
public class GraphManagerImpl implements GraphManager {
- private static final Logger LOG = LoggerFactory.getLogger( GraphManagerImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( GraphManagerImpl.class );
private final ApplicationScope scope;
@@ -188,7 +188,9 @@ public class GraphManagerImpl implements GraphManager {
final MutationBatch edgeMutation = storageEdgeSerialization.writeEdge( scope, edge1, timestamp );
- LOG.debug( "Marking edge {} as deleted to commit log", edge1 );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Marking edge {} as deleted to commit log", edge1);
+ }
try {
edgeMutation.execute();
}
@@ -223,7 +225,7 @@ public class GraphManagerImpl implements GraphManager {
//fire our delete listener and wait for the results
edgeDeleteListener.receive( scope, marked, startTimestamp ).doOnNext(
//log them
- count -> LOG.debug( "removed {} types for edge {} ", count, edge ) )
+ count -> logger.trace( "removed {} types for edge {} ", count, edge ) )
//return the marked edge
.map( count -> marked ) );
@@ -241,7 +243,9 @@ public class GraphManagerImpl implements GraphManager {
final MutationBatch nodeMutation = nodeSerialization.mark( scope, id, timestamp );
- LOG.debug( "Marking node {} as deleted to node mark", node );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Marking node {} as deleted to node mark", node);
+ }
try {
nodeMutation.execute();
}
@@ -273,7 +277,7 @@ public class GraphManagerImpl implements GraphManager {
//set to 0 if nothing is emitted
.lastOrDefault( 0 )
//log for posterity
- .doOnNext( count -> LOG.debug( "Removed {} edges from node {}", count, inputNode ) )
+ .doOnNext( count -> logger.trace( "Removed {} edges from node {}", count, inputNode ) )
//return our id
.map( count -> inputNode );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java
index 206145a..be9ef6b 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java
@@ -51,7 +51,6 @@ import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
import rx.Observable;
import rx.functions.Action1;
-import rx.functions.Func1;
import rx.observables.MathObservable;
@@ -62,7 +61,7 @@ import rx.observables.MathObservable;
public class EdgeMetaRepairImpl implements EdgeMetaRepair {
- private static final Logger LOG = LoggerFactory.getLogger( EdgeMetaRepairImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( EdgeMetaRepairImpl.class );
private static final Log RX_LOG = new Log();
private final EdgeMetadataSerialization edgeMetadataSerialization;
@@ -128,8 +127,10 @@ public class EdgeMetaRepairImpl implements EdgeMetaRepair {
//for each id type, check if the exist in parallel to increase processing speed
for ( final String subType : types ) {
- LOG.debug( "Checking for edges with nodeId {}, type {}, and subtype {}", node, edgeType,
- subType );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Checking for edges with nodeId {}, type {}, and subtype {}", node, edgeType,
+ subType);
+ }
Observable<Integer> search =
//load each edge in it's own thread
@@ -147,16 +148,18 @@ public class EdgeMetaRepairImpl implements EdgeMetaRepair {
* iteration
**/
if ( count != 0 ) {
- LOG.debug( "Found edge with nodeId {}, type {}, "
- + "and subtype {}. Not removing subtype. ",
- node, edgeType, subType );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Found edge with nodeId {}, type {}, and subtype {}. Not removing subtype. ",
+ node, edgeType, subType);
+ }
return;
}
- LOG.debug( "No edges with nodeId {}, type {}, "
- + "and subtype {}. Removing subtype.", node,
- edgeType, subType );
+ if (logger.isTraceEnabled()) {
+ logger.trace("No edges with nodeId {}, type {}, and subtype {}. Removing subtype.",
+ node, edgeType, subType);
+ }
batch.mergeShallow( serialization
.removeEdgeSubType( scope, node, edgeType, subType,
maxTimestamp ) );
@@ -176,9 +179,10 @@ public class EdgeMetaRepairImpl implements EdgeMetaRepair {
.doOnNext( count -> {
- LOG.debug( "Executing batch for subtype deletion with " +
- "type {}. " + "Mutation has {} rows to mutate ",
- edgeType, batch.getRowCount() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Executing batch for subtype deletion with type {}. Mutation has {} rows to mutate ",
+ edgeType, batch.getRowCount());
+ }
try {
batch.execute();
@@ -204,14 +208,18 @@ public class EdgeMetaRepairImpl implements EdgeMetaRepair {
* We can only execute deleting this type if no sub types were deleted
*/
if ( subTypeUsedCount != 0 ) {
- LOG.debug( "Type {} has {} subtypes in use as of maxTimestamp {}. Not deleting type.", edgeType,
- subTypeUsedCount, maxTimestamp );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Type {} has {} subtypes in use as of maxTimestamp {}. Not deleting type.", edgeType,
+ subTypeUsedCount, maxTimestamp);
+ }
return;
}
- LOG.debug( "Type {} has no subtypes in use as of maxTimestamp {}. Deleting type.", edgeType,
- maxTimestamp );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Type {} has no subtypes in use as of maxTimestamp {}. Deleting type.", edgeType,
+ maxTimestamp);
+ }
try {
serialization.removeEdgeType( scope, node, edgeType, maxTimestamp ).execute();
}
@@ -355,7 +363,9 @@ public class EdgeMetaRepairImpl implements EdgeMetaRepair {
@Override
public void call( final MarkedEdge markedEdge ) {
- LOG.debug( "Emitting edge {}", markedEdge );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Emitting edge {}", markedEdge);
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java
index 343cc77..cd5b1a8 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java
@@ -21,7 +21,6 @@ package org.apache.usergrid.persistence.graph.impl.stage;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.List;
import java.util.Set;
import java.util.UUID;
@@ -51,7 +50,6 @@ import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
import rx.Observable;
import rx.functions.Action0;
import rx.functions.Func1;
-import rx.schedulers.Schedulers;
/**
@@ -60,7 +58,7 @@ import rx.schedulers.Schedulers;
public class NodeDeleteListenerImpl implements NodeDeleteListener {
- private static final Logger LOG = LoggerFactory.getLogger( NodeDeleteListenerImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( NodeDeleteListenerImpl.class );
private final NodeSerialization nodeSerialization;
private final EdgeSerialization storageSerialization;
@@ -112,7 +110,9 @@ public class NodeDeleteListenerImpl implements NodeDeleteListener {
final Optional<Long> maxVersion = nodeSerialization.getMaxVersion( scope, node );
- LOG.debug( "Node with id {} has max version of {}", node, maxVersion.orNull() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Node with id {} has max version of {}", node, maxVersion.orNull());
+ }
if ( !maxVersion.isPresent() ) {
@@ -184,7 +184,9 @@ public class NodeDeleteListenerImpl implements NodeDeleteListener {
//buffer and delete marked edges in our buffer size so we're making less trips to cassandra
.buffer( graphFig.getScanPageSize() ).flatMap( markedEdges -> {
- LOG.debug( "Batching {} edges for node {} for deletion", markedEdges.size(), node );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Batching {} edges for node {} for deletion", markedEdges.size(), node);
+ }
final MutationBatch batch = keyspace.prepareMutationBatch();
@@ -219,14 +221,18 @@ public class NodeDeleteListenerImpl implements NodeDeleteListener {
//we want them running on the i/o thread from the Observable emitting all the edges
//
- LOG.debug( "About to audit {} source types", sourceNodes.size() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("About to audit {} source types", sourceNodes.size());
+ }
Observable<Integer> sourceMetaCleanup =
Observable.from( sourceNodes ).flatMap( targetPair -> edgeMetaRepair
.repairSources( scope, targetPair.id, targetPair.edgeType, maxVersion ) ).last();
- LOG.debug( "About to audit {} target types", targetNodes.size() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("About to audit {} target types", targetNodes.size());
+ }
Observable<Integer> targetMetaCleanup =
Observable.from( targetNodes ).flatMap( targetPair -> edgeMetaRepair
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgesObservableImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgesObservableImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgesObservableImpl.java
index bd76291..20efe42 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgesObservableImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgesObservableImpl.java
@@ -61,7 +61,9 @@ public class EdgesObservableImpl implements EdgesObservable {
return edgeTypes.flatMap( edgeType -> {
- logger.debug( "Loading edges of edgeType {} from {}", edgeType, sourceNode );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Loading edges of edgeType {} from {}", edgeType, sourceNode);
+ }
return gm.loadEdgesFromSource(
new SimpleSearchByEdgeType( sourceNode, edgeType, Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING,
@@ -82,7 +84,9 @@ public class EdgesObservableImpl implements EdgesObservable {
return edgeTypes.flatMap( edgeType -> {
- logger.debug( "Loading edges of edgeType {} from {}", edgeType, sourceNode );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Loading edges of edgeType {} from {}", edgeType, sourceNode);
+ }
return gm.loadEdgesFromSource(
new SimpleSearchByEdgeType( sourceNode, edgeType, Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING,
@@ -100,7 +104,9 @@ public class EdgesObservableImpl implements EdgesObservable {
return edgeTypes.flatMap( edgeType -> {
- logger.debug( "Loading edges of edgeType {} from {}", edgeType, sourceNode );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Loading edges of edgeType {} from {}", edgeType, sourceNode);
+ }
return gm.loadEdgesFromSourceByType(
new SimpleSearchByIdType( sourceNode, edgeType, Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING,
@@ -119,7 +125,9 @@ public class EdgesObservableImpl implements EdgesObservable {
return edgeTypes.flatMap( edgeType -> {
- logger.debug( "Loading edges of edgeType {} to {}", edgeType, targetNode );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Loading edges of edgeType {} to {}", edgeType, targetNode);
+ }
return gm.loadEdgesToTarget(
new SimpleSearchByEdgeType( targetNode, edgeType, Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING,
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/TargetIdObservableImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/TargetIdObservableImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/TargetIdObservableImpl.java
index bd8cd3c..6a08d46 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/TargetIdObservableImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/TargetIdObservableImpl.java
@@ -58,7 +58,9 @@ public class TargetIdObservableImpl implements TargetIdObservable {
return edgesFromSourceObservable.edgesFromSourceDescending( gm, sourceNode ).map( edge -> {
final Id targetNode = edge.getTargetNode();
- logger.debug( "Emitting targetId of {}", edge );
+ if (logger.isDebugEnabled()) {
+ logger.debug("Emitting targetId of {}", edge);
+ }
return targetNode;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java
index 15ff337..8eccdbd 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/migration/EdgeDataMigrationImpl.java
@@ -94,7 +94,7 @@ public class EdgeDataMigrationImpl implements DataMigration {
final MutationBatch batch = keyspace.prepareMutationBatch();
for ( Edge edge : edges ) {
- logger.info( "Migrating meta for edge {}", edge );
+ logger.info("Migrating meta for edge {}", edge);
final MutationBatch edgeBatch =
migration.to.writeEdge( graphNode.applicationScope, edge );
batch.mergeShallow( edgeBatch );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
index 403ccf8..781e737 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
@@ -41,7 +41,7 @@ import com.google.common.base.Preconditions;
*/
public class ShardEntryGroup {
- private static final Logger LOG = LoggerFactory.getLogger( ShardEntryGroup.class );
+ private static final Logger logger = LoggerFactory.getLogger( ShardEntryGroup.class );
private List<Shard> shards;
@@ -143,12 +143,16 @@ public class ShardEntryGroup {
if(compactionTarget != null){
- LOG.debug( "Returning shards {} and {} as read shards", compactionTarget, staticShard );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Returning shards {} and {} as read shards", compactionTarget, staticShard);
+ }
return Arrays.asList( compactionTarget, staticShard );
}
- LOG.debug( "Returning shards {} read shard", staticShard );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Returning shards {} read shard", staticShard);
+ }
return Collections.singleton( staticShard );
}
@@ -168,7 +172,9 @@ public class ShardEntryGroup {
final Shard compactionTarget = getCompactionTarget();
- LOG.debug( "Returning shard {} as write shard", compactionTarget);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Returning shard {} as write shard", compactionTarget);
+ }
return Collections.singleton( compactionTarget );
@@ -177,7 +183,9 @@ public class ShardEntryGroup {
final Shard staticShard = getRootShard();
- LOG.debug( "Returning shard {} as write shard", staticShard);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Returning shard {} as write shard", staticShard);
+ }
return Collections.singleton( staticShard );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 116e526..a79b91a 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
@@ -200,7 +200,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
if ( !edges.hasNext() ) {
if (logger.isTraceEnabled()) logger.trace(
- "Tried to allocate a new shard for edge meta data {}, " + "but no max value could be found in that row",
+ "Tried to allocate a new shard for edge meta data {}, but no max value could be found in that row",
directedEdgeMeta );
return false;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java
index c5f0bfb..1a88ebb 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java
@@ -70,7 +70,7 @@ import com.google.inject.Inject;
*/
public class NodeShardCacheImpl implements NodeShardCache {
- private static final Logger LOG = LoggerFactory.getLogger( NodeShardCacheImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( NodeShardCacheImpl.class );
/**
* Only cache shards that have < 10k groups. This is an arbitrary amount, and may change with profiling and
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
index f398fa2..f0b0ac9 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
@@ -147,8 +147,8 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
Preconditions
.checkArgument( group.shouldCompact( startTime ), "Compaction cannot be run yet. Ignoring compaction." );
- if(logger.isDebugEnabled()) {
- logger.debug("Compacting shard group. Audit count is {} ", countAudits.get());
+ if(logger.isTraceEnabled()) {
+ logger.trace("Compacting shard group. Audit count is {} ", countAudits.get());
}
final CompactionResult.CompactionBuilder resultBuilder = CompactionResult.builder();
@@ -229,7 +229,9 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
}
- logger.info( "Finished compacting {} shards and moved {} edges", sourceShards, edgeCount );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Finished compacting {} shards and moved {} edges", sourceShards, edgeCount);
+ }
resultBuilder.withCopiedEdges( edgeCount ).withSourceShards( sourceShards ).withTargetShard( targetShard );
@@ -304,8 +306,8 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
countAudits.getAndIncrement();
- if(logger.isDebugEnabled()) {
- logger.debug("Auditing shard group {}. count is {} ", group, countAudits.get());
+ if(logger.isTraceEnabled()) {
+ logger.trace("Auditing shard group {}. count is {} ", group, countAudits.get());
}
/**
@@ -320,7 +322,7 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
catch ( RejectedExecutionException ree ) {
//ignore, if this happens we don't care, we're saturated, we can check later
- logger.error( "Rejected audit for shard of scope {} edge, meta {} and group {}", scope, edgeMeta, group );
+ logger.info( "Rejected audit for shard of scope {} edge, meta {} and group {}", scope, edgeMeta, group );
return Futures.immediateFuture( AuditResult.NOT_CHECKED );
}
@@ -331,7 +333,9 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
Futures.addCallback( future, new FutureCallback<AuditResult>() {
@Override
public void onSuccess( @Nullable final AuditResult result ) {
- logger.debug( "Successfully completed audit of task {}", result );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Successfully completed audit of task {}", result);
+ }
}
@@ -412,8 +416,8 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
*/
try {
CompactionResult result = compact( scope, edgeMeta, group );
- logger.info( "Compaction result for compaction of scope {} with edge meta data of {} and shard group "
- + "{} is {}", new Object[] { scope, edgeMeta, group, result } );
+ logger.info( "Compaction result for compaction of scope {} with edge meta data of {} and shard group {} is {}",
+ scope, edgeMeta, group, result );
}
finally {
shardCompactionTaskTracker.complete( scope, edgeMeta, group );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 6a86385..2fc0d50 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
@@ -91,7 +91,7 @@ public class ShardGroupDeletionImpl implements ShardGroupDeletion {
catch ( RejectedExecutionException ree ) {
//ignore, if this happens we don't care, we're saturated, we can check later
- logger.error( "Rejected shard delete check for group {}", edgeIterator );
+ logger.info( "Rejected shard delete check for group {}", edgeIterator );
return Futures.immediateFuture( DeleteResult.NOT_CHECKED );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
index 42912e9..e466de0 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
@@ -36,7 +36,7 @@ import org.apache.usergrid.persistence.model.entity.EntityMap;
*/
public class EntityMappingParser implements FieldParser {
- private static final Logger log = LoggerFactory.getLogger( EntityMappingParser.class );
+ private static final Logger logger = LoggerFactory.getLogger( EntityMappingParser.class );
/**
@@ -113,8 +113,7 @@ public class EntityMappingParser implements FieldParser {
//we don't support indexing 2 dimensional arrays. Short circuit with a warning so we can track operationally
if(!lastCollection.isEmpty() && lastCollection.peek() instanceof Collection){
- log.warn( "Encountered 2 collections consecutively. " +
- "N+1 dimensional arrays are unsupported, only arrays of depth 1 are supported" );
+ logger.warn( "Encountered 2 collections consecutively. N+1 dimensional arrays are unsupported, only arrays of depth 1 are supported" );
return;
}
[6/7] usergrid git commit: USERGRID-1243: logging overhaul, pt. 2
Posted by mr...@apache.org.
USERGRID-1243: logging overhaul, pt. 2
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/54e62f95
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/54e62f95
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/54e62f95
Branch: refs/heads/master
Commit: 54e62f95c17158392d65141eb09ba2e94adb46c9
Parents: 71fb610
Author: Mike Dunker <md...@apigee.com>
Authored: Mon Feb 1 14:28:52 2016 -0800
Committer: Mike Dunker <md...@apigee.com>
Committed: Mon Feb 1 14:28:52 2016 -0800
----------------------------------------------------------------------
.../management/AppInfoMigrationPlugin.java | 2 +-
.../cassandra/ManagementServiceImpl.java | 71 +++++-----
.../usergrid/management/export/ExportJob.java | 7 +-
.../management/export/ExportServiceImpl.java | 7 +-
.../management/export/S3ExportImpl.java | 2 +-
.../management/importer/FileImportJob.java | 6 +-
.../usergrid/management/importer/ImportJob.java | 8 +-
.../management/importer/ImportServiceImpl.java | 135 +++++++++----------
.../management/importer/S3ImportImpl.java | 4 +-
.../usergrid/security/AuthPrincipalType.java | 4 +-
.../security/crypto/EncryptionServiceImpl.java | 8 +-
.../usergrid/security/oauth/AccessInfo.java | 2 +-
.../security/providers/AbstractProvider.java | 4 +-
.../security/providers/FacebookProvider.java | 4 +-
.../security/providers/FoursquareProvider.java | 4 +-
.../apache/usergrid/security/shiro/Realm.java | 6 +-
.../usergrid/security/shiro/ShiroCache.java | 21 +--
.../security/shiro/ShiroCacheManager.java | 2 +-
.../shiro/principals/PrincipalIdentifier.java | 8 +-
.../security/shiro/utils/SubjectUtils.java | 4 +-
.../usergrid/security/tokens/TokenCategory.java | 4 +-
.../services/AbstractCollectionService.java | 39 +++---
.../services/AbstractConnectionsService.java | 12 +-
.../AbstractPathBasedColllectionService.java | 10 +-
.../usergrid/services/AbstractService.java | 4 +-
.../apache/usergrid/services/ServiceInfo.java | 2 +-
.../usergrid/services/ServiceManager.java | 16 +--
.../usergrid/services/ServiceParameter.java | 44 ++----
.../usergrid/services/ServiceResults.java | 8 +-
.../services/activities/ActivitiesService.java | 4 +-
.../applications/ApplicationsService.java | 6 +-
.../usergrid/services/assets/AssetsService.java | 12 +-
.../services/assets/data/AssetMimeHandler.java | 4 +-
.../services/assets/data/AssetUtils.java | 4 +-
.../assets/data/AwsSdkS3BinaryStore.java | 6 +-
.../assets/data/LocalFileBinaryStore.java | 4 +-
.../services/assets/data/S3BinaryStore.java | 36 ++---
.../services/devices/DevicesService.java | 12 +-
.../notifications/NotificationsService.java | 4 +-
.../usergrid/services/groups/GroupsService.java | 8 +-
.../groups/activities/ActivitiesService.java | 4 +-
.../notifications/NotificationsService.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 +-
.../notifications/NotificationsService.java | 4 +-
.../services/messages/MessagesService.java | 4 +-
.../notifications/ApplicationQueueMessage.java | 2 +-
.../notifications/InactiveDeviceManager.java | 8 +-
.../services/notifications/JobScheduler.java | 8 +-
.../notifications/NotificationsService.java | 16 ++-
.../services/notifications/QueueJob.java | 16 ++-
.../services/notifications/QueueListener.java | 48 +++++--
.../services/notifications/TaskManager.java | 36 +++--
.../notifications/apns/APNsAdapter.java | 4 +-
.../apns/RejectedAPNsListener.java | 4 +-
.../services/notifications/gcm/GCMAdapter.java | 16 ++-
.../impl/ApplicationQueueManagerImpl.java | 88 ++++++++----
.../services/notifiers/NotifiersService.java | 4 +-
.../services/queues/ImportQueueListener.java | 4 +-
.../usergrid/services/queues/QueueListener.java | 50 +++++--
.../usergrid/services/roles/RolesService.java | 4 +-
.../services/roles/groups/GroupsService.java | 4 +-
.../services/roles/users/UsersService.java | 4 +-
.../usergrid/services/users/UsersService.java | 6 +-
.../users/activities/ActivitiesService.java | 4 +-
.../services/users/devices/DevicesService.java | 20 +--
.../notifications/NotificationsService.java | 4 +-
.../users/following/FollowingService.java | 4 +-
.../services/users/groups/GroupsService.java | 4 +-
.../notifications/NotificationsService.java | 4 +-
.../services/users/roles/RolesService.java | 4 +-
.../org/apache/usergrid/utils/PythonUtils.java | 4 +-
.../usergrid/cassandra/CassandraResource.java | 2 +-
75 files changed, 529 insertions(+), 423 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java b/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java
index d14a855..2412bec 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java
@@ -143,7 +143,7 @@ public class AppInfoMigrationPlugin implements MigrationPlugin {
if ( version == getMaxVersion() ) {
if (logger.isDebugEnabled()) {
- logger.debug("Skipping Migration Plugin: " + getName());
+ logger.debug("Skipping Migration Plugin: {}", getName());
}
return;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index a3a6aa9..bf9dbfe 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -448,8 +448,8 @@ public class ManagementServiceImpl implements ManagementService {
public OrganizationOwnerInfo createOwnerAndOrganization( String organizationName, String username, String name,
String email, String password ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug("createOwnerAndOrganization1");
+ if(logger.isTraceEnabled()){
+ logger.trace("createOwnerAndOrganization(1)");
}
boolean activated = !newAdminUsersNeedSysAdminApproval() && !newOrganizationsNeedSysAdminApproval();
boolean disabled = newAdminUsersRequireConfirmation();
@@ -464,8 +464,8 @@ public class ManagementServiceImpl implements ManagementService {
public OrganizationOwnerInfo createOwnerAndOrganization( String organizationName, String username, String name,
String email, String password, boolean activated,
boolean disabled ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug("createOwnerAndOrganization2");
+ if(logger.isTraceEnabled()){
+ logger.trace("createOwnerAndOrganization(2)");
}
return createOwnerAndOrganization( organizationName, username, name, email, password,
activated, disabled, null, null );
@@ -479,9 +479,7 @@ public class ManagementServiceImpl implements ManagementService {
Map<String, Object> organizationProperties )
throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug("createOwnerAndOrganization3");
- }
+ logger.info("createOwnerAndOrganization: {} {}", organizationName, email);
/**
* Only lock on the target values. We don't want lock contention if another
@@ -516,8 +514,8 @@ public class ManagementServiceImpl implements ManagementService {
user = createAdminUserInternal( null, username, name, email, password, activated, disabled, userProperties );
}
- if(logger.isDebugEnabled()){
- logger.debug("User created");
+ if(logger.isTraceEnabled()){
+ logger.debug("createOwnerAndOrganization: User created");
}
organization = createOrganizationInternal( null, organizationName, user, true, organizationProperties );
}
@@ -533,8 +531,8 @@ public class ManagementServiceImpl implements ManagementService {
private OrganizationInfo createOrganizationInternal(
UUID orgUuid, String organizationName, UserInfo user, boolean activated ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug("createOrganizationInternal1");
+ if(logger.isTraceEnabled()){
+ logger.trace("createOrganizationInternal(1): {}", organizationName);
}
return createOrganizationInternal( orgUuid, organizationName, user, activated, null );
}
@@ -543,8 +541,8 @@ public class ManagementServiceImpl implements ManagementService {
private OrganizationInfo createOrganizationInternal( UUID orgUuid, String organizationName, UserInfo user, boolean activated,
Map<String, Object> properties ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "createOrganizationInternal2: {}", organizationName );
+ if(logger.isTraceEnabled()){
+ logger.trace( "createOrganizationInternal(2): {}", organizationName );
}
if ( organizationName == null ) {
@@ -555,7 +553,7 @@ public class ManagementServiceImpl implements ManagementService {
}
if ( user == null ) {
if(logger.isDebugEnabled()){
- logger.debug("user = null");
+ logger.debug("user = null (organizationName = {})", organizationName);
}
return null;
}
@@ -611,11 +609,15 @@ public class ManagementServiceImpl implements ManagementService {
throws Exception {
if ( organizationName == null ) {
- logger.debug("organizationName = null");
+ if (logger.isTraceEnabled()) {
+ logger.trace("organizationName = null");
+ }
return null;
}
if ( user == null ) {
- logger.debug("user = null");
+ if (logger.isTraceEnabled()) {
+ logger.trace("user = null");
+ }
return null;
}
@@ -1140,11 +1142,15 @@ public class ManagementServiceImpl implements ManagementService {
Identifier.fromUUID( UUID.fromString( identifierString ) ) );
if ( entity != null ) {
user = ( User ) entity.toTypedEntity();
- logger.info( "Found user {} as a UUID", identifierString );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Found user {} as a UUID", identifierString);
+ }
}
}
catch ( Exception e ) {
- logger.warn( "Unable to get user " + identifierString + " as a UUID, trying username..." );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Unable to get user {} as a UUID, trying username...", identifierString);
+ }
}
return user;
}
@@ -1155,12 +1161,13 @@ public class ManagementServiceImpl implements ManagementService {
Entity entity = getUserEntityByIdentifier( applicationId, identifier );
if ( entity != null ) {
user = ( User ) entity.toTypedEntity();
- logger.info( "Found user {} as an {}", identifierString, identifier.getType() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Found user {} as an {}", identifierString, identifier.getType());
+ }
}
}
catch ( Exception e ) {
- logger.warn( "Unable to get user {} as a {}", identifierString, identifier.getType());
- logger.warn( "Exception", e);
+ logger.warn( "Unable to get user {} as a {}", identifierString, identifier.getType(), e);
}
if ( user != null ) {
return user;
@@ -1255,8 +1262,8 @@ public class ManagementServiceImpl implements ManagementService {
public int calculatePasswordHistorySizeForUser( UUID userId ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug( "calculatePasswordHistorySizeForUser " + userId.toString() );
+ if(logger.isTraceEnabled()){
+ logger.trace( "calculatePasswordHistorySizeForUser {}", userId.toString() );
}
int size = 0;
@@ -1265,8 +1272,8 @@ public class ManagementServiceImpl implements ManagementService {
Results orgResults = em.getCollection( new SimpleEntityRef( User.ENTITY_TYPE, userId ),
Schema.COLLECTION_GROUPS, null, 10000, Level.REFS, false );
- if(logger.isDebugEnabled()){
- logger.debug(" orgResults.size() = " + orgResults.size());
+ if(logger.isTraceEnabled()){
+ logger.trace(" orgResults.size() = {}", orgResults.size());
}
for ( EntityRef orgRef : orgResults.getRefs() ) {
@@ -1275,8 +1282,8 @@ public class ManagementServiceImpl implements ManagementService {
if ( properties != null ) {
OrganizationInfo orgInfo = new OrganizationInfo( null, null, properties );
- if(logger.isDebugEnabled()){
- logger.debug( " orgInfo.getPasswordHistorySize() = " + orgInfo.getPasswordHistorySize() );
+ if(logger.isTraceEnabled()){
+ logger.trace( " orgInfo.getPasswordHistorySize() = {}", orgInfo.getPasswordHistorySize() );
}
size = Math.max( orgInfo.getPasswordHistorySize(), size );
@@ -1301,8 +1308,8 @@ public class ManagementServiceImpl implements ManagementService {
@Override
public UserInfo verifyAdminUserPasswordCredentials( String name, String password ) throws Exception {
- if(logger.isDebugEnabled()){
- logger.debug("verifyAdminUserPasswordCredentials for {}/{}", name, password);
+ if(logger.isTraceEnabled()){
+ logger.trace("verifyAdminUserPasswordCredentials for {}", name);
}
User user = findUserEntity( smf.getManagementAppId(), name );
@@ -1547,7 +1554,7 @@ public class ManagementServiceImpl implements ManagementService {
try {
organizations.put( entity.getUuid(), path );
} catch (IllegalArgumentException e) {
- logger.warn("Error adding " + entity.getUuid() + ":" + path + " to BiMap: " + e.getMessage() );
+ logger.warn("Error adding {}:{} to BiMap: {}", entity.getUuid(), path, e.getMessage() );
}
}
@@ -1653,7 +1660,7 @@ public class ManagementServiceImpl implements ManagementService {
if(em.getCollection(organization.getUuid() ,"users",Query.fromQL( "select * where uuid ="+user.getUuid() ),Level.IDS ).size() >0){
if(logger.isDebugEnabled()) {
- logger.debug( "Found value: {} already in collection", user.getName() );
+ logger.debug( "addAdminUserToOrganization - Found value: {} already in collection", user.getName() );
}
return;
}
@@ -2385,7 +2392,7 @@ public class ManagementServiceImpl implements ManagementService {
}
}
catch ( Exception e ) {
- logger.error( "Unable to send activation emails to " + organization.getName(), e );
+ logger.error( "Unable to send activation emails to {}", organization.getName(), e );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
index 3bdfac9..03c3353 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
@@ -40,7 +40,9 @@ public class ExportJob extends OnlyOnceJob {
ExportService exportService;
public ExportJob() {
- logger.info( "ExportJob created " + this );
+ if (logger.isTraceEnabled()) {
+ logger.trace("ExportJob created");
+ }
}
@@ -59,8 +61,7 @@ public class ExportJob extends OnlyOnceJob {
exportService.doExport( jobExecution );
}
catch ( Exception e ) {
- logger.error( "Export Service failed to complete job" );
- logger.error(e.getMessage());
+ logger.error( "Export Service failed to complete job: {}", e.getMessage() );
return;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
index 31e8544..eadc925 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
@@ -87,7 +87,7 @@ public class ExportServiceImpl implements ExportService {
return null;
}
- EntityManager em = null;
+ EntityManager em;
try {
em = emf.getEntityManager( emf.getManagementAppId() );
Set<String> collections = em.getApplicationCollections();
@@ -188,9 +188,10 @@ public class ExportServiceImpl implements ExportService {
@Override
public void doExport( final JobExecution jobExecution ) throws Exception {
+ @SuppressWarnings("unchecked")
Map<String, Object> config = ( Map<String, Object> ) jobExecution.getJobData().getProperty( "exportInfo" );
Object s3PlaceHolder = jobExecution.getJobData().getProperty( "s3Export" );
- S3Export s3Export = null;
+ S3Export s3Export;
if ( config == null ) {
logger.error( "Export Information passed through is null" );
@@ -222,7 +223,7 @@ public class ExportServiceImpl implements ExportService {
}
if ( config.get( "organizationId" ) == null ) {
- logger.error( "No organization could be found" );
+ logger.error( "doExport: No organization could be found" );
export.setState( Export.State.FAILED );
em.update( export );
return;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
index f8005d1..c09e4d2 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
@@ -72,7 +72,7 @@ public class S3ExportImpl implements S3Export {
try {
BlobStore blobStore = context.getBlobStore();
if ( blobStore.createContainerInLocation(null, bucketName) ) {
- logger.info( "Created bucket " + bucketName );
+ logger.info( "Created bucket {}", bucketName );
}
}
catch ( Exception ex ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
index f734b3f..be0b943 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
@@ -48,7 +48,9 @@ public class FileImportJob extends OnlyOnceJob {
ImportService importService;
public FileImportJob() {
- logger.info( "FileImportJob created " + this );
+ if (logger.isTraceEnabled()) {
+ logger.info("FileImportJob created");
+ }
}
@Override
@@ -81,7 +83,7 @@ public class FileImportJob extends OnlyOnceJob {
throw t;
}
- logger.info("File Import Service completed job: " + jobExecution.getJobName() );
+ logger.info("File Import Service completed job: {}", jobExecution.getJobName() );
}
@Override
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java
index 4640681..935f12c 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java
@@ -47,7 +47,9 @@ public class ImportJob extends OnlyOnceJob {
ImportService importService;
public ImportJob(){
- logger.info( "ImportJob created " + this );
+ if (logger.isTraceEnabled()) {
+ logger.info("ImportJob created");
+ }
}
@Override
@@ -82,7 +84,9 @@ public class ImportJob extends OnlyOnceJob {
throw t;
}
- logger.error("Import Service completed job");
+ if (logger.isTraceEnabled()) {
+ logger.trace("Import Service completed job");
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
index 2f1b994..6c1ffc0 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
@@ -94,7 +94,7 @@ public class ImportServiceImpl implements ImportService {
try {
rootEM = emf.getEntityManager(emf.getManagementAppId());
} catch (Exception e) {
- logger.error("application doesn't exist within the current context");
+ logger.error("application doesn't exist within the current context", e);
return null;
}
@@ -105,7 +105,7 @@ public class ImportServiceImpl implements ImportService {
try {
importEntity = rootEM.create(importEntity);
} catch (Exception e) {
- logger.error("Import entity creation failed");
+ logger.error("Import entity creation failed", e);
return null;
}
@@ -313,9 +313,9 @@ public class ImportServiceImpl implements ImportService {
*/
private JobData createFileTask(Map<String, Object> config, String file, EntityRef importRef) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("scheduleFile() for import {}:{} file {}",
- new Object[]{importRef.getType(), importRef.getType(), file});
+ if (logger.isTraceEnabled()) {
+ logger.trace("scheduleFile() for import {}:{} file {}",
+ importRef.getType(), importRef.getType(), file);
}
EntityManager rootEM;
@@ -338,16 +338,15 @@ public class ImportServiceImpl implements ImportService {
// create a connection between the main import job and the sub FileImport Job
rootEM.createConnection(importEntity, IMPORT_FILE_INCLUDES_CONNECTION, fileImport);
- if (logger.isDebugEnabled()) {
- logger.debug("Created connection from {}:{} to {}:{}",
- new Object[]{
+ if (logger.isTraceEnabled()) {
+ logger.trace("Created connection from {}:{} to {}:{}",
importEntity.getType(), importEntity.getUuid(),
fileImport.getType(), fileImport.getUuid()
- });
+ );
}
} catch (Exception e) {
- logger.error(e.getMessage());
+ logger.error("Exception creating file task connection", e.getMessage());
return null;
}
@@ -523,21 +522,21 @@ public class ImportServiceImpl implements ImportService {
@Override
public void doImport(JobExecution jobExecution) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("doImport()");
+ if (logger.isTraceEnabled()) {
+ logger.trace("doImport()");
}
- Map<String, Object> config =
- (Map<String, Object>) jobExecution.getJobData().getProperty("importInfo");
+ @SuppressWarnings("unchecked")
+ Map<String, Object> config = (Map<String, Object>) jobExecution.getJobData().getProperty("importInfo");
if (config == null) {
logger.error("doImport(): Import Information passed through is null");
return;
}
- Map<String, Object> properties =
- (Map<String, Object>) config.get("properties");
- Map<String, Object> storage_info =
- (Map<String, Object>) properties.get("storage_info");
+ @SuppressWarnings("unchecked")
+ Map<String, Object> properties = (Map<String, Object>) config.get("properties");
+ @SuppressWarnings("unchecked")
+ Map<String, Object> storage_info = (Map<String, Object>) properties.get("storage_info");
String bucketName = (String) storage_info.get("bucket_location");
String accessId = (String) storage_info.get("s3_access_id");
@@ -553,8 +552,8 @@ public class ImportServiceImpl implements ImportService {
importEntity.setStarted(System.currentTimeMillis());
importEntity.setErrorMessage(" ");
rootEM.update(importEntity);
- if (logger.isDebugEnabled()) {
- logger.debug("doImport(): updated state");
+ if (logger.isTraceEnabled()) {
+ logger.trace("doImport(): updated state");
}
// if no S3 importer was passed in then create one
@@ -633,13 +632,13 @@ public class ImportServiceImpl implements ImportService {
final int count = getConnectionCount(importEntity);
if (count == fileJobs.size()) {
- if (logger.isDebugEnabled()) {
- logger.debug("Got ALL {} of {} expected connections", count, fileJobs.size());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Got ALL {} of {} expected connections", count, fileJobs.size());
}
done = true;
} else {
- if (logger.isDebugEnabled()) {
- logger.debug("Got {} of {} expected connections. Waiting...", count, fileJobs.size());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Got {} of {} expected connections. Waiting...", count, fileJobs.size());
}
Thread.sleep(1000);
}
@@ -673,14 +672,14 @@ public class ImportServiceImpl implements ImportService {
// get values we need
- Map<String, Object> properties =
- (Map<String, Object>) jobExecution.getJobData().getProperty("properties");
+ @SuppressWarnings("unchecked")
+ Map<String, Object> properties = (Map<String, Object>) jobExecution.getJobData().getProperty("properties");
if (properties == null) {
logger.error("downloadAndImportFile(): Import Information passed through is null");
return;
}
- Map<String, Object> storage_info =
- (Map<String, Object>) properties.get("storage_info");
+ @SuppressWarnings("unchecked")
+ Map<String, Object> storage_info = (Map<String, Object>) properties.get("storage_info");
String bucketName = (String) storage_info.get("bucket_location");
String accessId = (String) storage_info.get("s3_access_id");
@@ -805,6 +804,7 @@ public class ImportServiceImpl implements ImportService {
try {
Thread.sleep(5000);
} catch (Exception intentionallyIgnored) {
+ // intentionally ignored
}
// get file import entities for this import job
@@ -818,13 +818,13 @@ public class ImportServiceImpl implements ImportService {
PagingResultsIterator itr = new PagingResultsIterator(entities);
if (!itr.hasNext()) {
- logger.warn("Found no FileImport entities for import {}, " +
- "unable to check if complete", importEntity.getUuid());
+ logger.warn("Found no FileImport entities for import {}, unable to check if complete",
+ importEntity.getUuid());
return;
}
- if (logger.isDebugEnabled()) {
- logger.debug("Checking {} file import jobs to see if we are done for file {}",
+ if (logger.isTraceEnabled()) {
+ logger.trace("Checking {} file import jobs to see if we are done for file {}",
new Object[]{entities.size(), fileImport.getFileName()});
}
@@ -842,7 +842,7 @@ public class ImportServiceImpl implements ImportService {
continue;
default: // not something we recognize as complete, short circuit
if (logger.isDebugEnabled()) {
- logger.debug("not done yet, bail out...");
+ logger.debug("not done yet, bail out... {}", fi.getState().toString());
}
return;
}
@@ -857,13 +857,13 @@ public class ImportServiceImpl implements ImportService {
}
}
- if (logger.isDebugEnabled()) {
- logger.debug("successCount = {} failCount = {}", new Object[]{successCount, failCount});
+ if (logger.isTraceEnabled()) {
+ logger.trace("successCount = {} failCount = {}", successCount, failCount);
}
if (importEntity != null) {
- if (logger.isDebugEnabled()) {
- logger.debug("FINISHED");
+ if (logger.isTraceEnabled()) {
+ logger.trace("FINISHED");
}
if (failCount == 0) {
@@ -875,9 +875,9 @@ public class ImportServiceImpl implements ImportService {
try {
rootEM.update(importEntity);
- if (logger.isDebugEnabled()) {
- logger.debug("Updated import entity {}:{} with state {}",
- new Object[]{importEntity.getType(), importEntity.getUuid(), importEntity.getState()});
+ if (logger.isTraceEnabled()) {
+ logger.trace("Updated import entity {}:{} with state {}",
+ importEntity.getType(), importEntity.getUuid(), importEntity.getState());
}
} catch (Exception e) {
logger.error("Error updating import entity", e);
@@ -945,14 +945,13 @@ public class ImportServiceImpl implements ImportService {
// FIRST PASS: import all entities in the file
- boolean entitiesOnly = true;
-
// observable that parses JSON and emits write events
JsonParser jp = getJsonParserForFile(file);
// TODO: move JSON parser into observable creation so open/close happens within the stream
+ // entitiesOnly = true
final JsonEntityParserObservable jsonObservableEntities =
- new JsonEntityParserObservable(jp, em, rootEm, fileImport, tracker, entitiesOnly);
+ new JsonEntityParserObservable(jp, em, rootEm, fileImport, tracker, true);
final Observable<WriteEvent> entityEventObservable = Observable.create(jsonObservableEntities);
@@ -970,28 +969,27 @@ public class ImportServiceImpl implements ImportService {
jp.close();
if (FileImport.State.FAILED.equals(fileImport.getState())) {
- if (logger.isDebugEnabled()) {
- logger.debug("\n\nFailed to completely write entities, skipping second phase. File: {}\n",
+ if (logger.isTraceEnabled()) {
+ logger.trace("\n\nFailed to completely write entities, skipping second phase. File: {}\n",
fileImport.getFileName());
}
return;
}
- if (logger.isDebugEnabled()) {
- logger.debug("\n\nWrote entities. File: {}\n", fileImport.getFileName());
+ if (logger.isTraceEnabled()) {
+ logger.trace("\n\nWrote entities. File: {}\n", fileImport.getFileName());
}
// SECOND PASS: import all connections and dictionaries
- entitiesOnly = false;
-
// observable that parses JSON and emits write events
jp = getJsonParserForFile(file);
// TODO: move JSON parser into observable creation so open/close happens within the stream
+ // entitiesOnly = false
final JsonEntityParserObservable jsonObservableOther =
- new JsonEntityParserObservable(jp, em, rootEm, fileImport, tracker, entitiesOnly);
+ new JsonEntityParserObservable(jp, em, rootEm, fileImport, tracker, false);
final Observable<WriteEvent> otherEventObservable = Observable.create(jsonObservableOther);
@@ -1008,8 +1006,8 @@ public class ImportServiceImpl implements ImportService {
jp.close();
- if (logger.isDebugEnabled()) {
- logger.debug("\n\nparseEntitiesAndConnectionsFromJson(): Wrote others for file {}\n",
+ if (logger.isTraceEnabled()) {
+ logger.trace("\n\nparseEntitiesAndConnectionsFromJson(): Wrote others for file {}\n",
fileImport.getFileName());
}
@@ -1025,14 +1023,14 @@ public class ImportServiceImpl implements ImportService {
if (FileImport.State.FAILED.equals(fileImport.getState())) {
if (logger.isDebugEnabled()) {
- logger.debug("\n\nFailed to completely wrote connections and dictionaries. File: {}\n",
+ logger.debug("\n\nFailed to completely write connections and dictionaries. File: {}\n",
fileImport.getFileName());
}
return;
}
- if (logger.isDebugEnabled()) {
- logger.debug("\n\nWrote connections and dictionaries. File: {}\n", fileImport.getFileName());
+ if (logger.isTraceEnabled()) {
+ logger.trace("\n\nWrote connections and dictionaries. File: {}\n", fileImport.getFileName());
}
}
@@ -1058,9 +1056,9 @@ public class ImportServiceImpl implements ImportService {
@Override
public void doWrite(EntityManager em, FileImport fileImport, FileImportTracker tracker) {
try {
- if (logger.isDebugEnabled()) {
- logger.debug("Writing imported entity {}:{} into app {}",
- new Object[]{entityType, entityUuid, em.getApplication().getUuid()});
+ if (logger.isTraceEnabled()) {
+ logger.trace("Writing imported entity {}:{} into app {}",
+ entityType, entityUuid, em.getApplication().getUuid());
}
em.create(entityUuid, entityType, properties);
@@ -1068,7 +1066,7 @@ public class ImportServiceImpl implements ImportService {
tracker.entityWritten();
} catch (Exception e) {
- logger.error("Error writing entity. From file:" + fileImport.getFileName(), e);
+ logger.error("Error writing entity. From file:{}", fileImport.getFileName(), e);
tracker.entityFailed(e.getMessage() + " From file: " + fileImport.getFileName());
}
@@ -1100,11 +1098,10 @@ public class ImportServiceImpl implements ImportService {
entityRef = em.get(ownerEntityRef.getUuid());
}
- if (logger.isDebugEnabled()) {
- logger.debug("Creating connection from {}:{} to {}:{}",
- new Object[]{
+ if (logger.isTraceEnabled()) {
+ logger.trace("Creating connection from {}:{} to {}:{}",
ownerEntityRef.getType(), ownerEntityRef.getUuid(),
- entityRef.getType(), entityRef.getUuid()});
+ entityRef.getType(), entityRef.getUuid());
}
em.createConnection(ownerEntityRef, connectionType, entityRef);
@@ -1112,7 +1109,7 @@ public class ImportServiceImpl implements ImportService {
tracker.connectionWritten();
} catch (Exception e) {
- logger.error("Error writing connection. From file: " + fileImport.getFileName(), e);
+ logger.error("Error writing connection. From file: {}", fileImport.getFileName(), e);
tracker.connectionFailed(e.getMessage() + " From file: " + fileImport.getFileName());
}
@@ -1137,9 +1134,9 @@ public class ImportServiceImpl implements ImportService {
public void doWrite(EntityManager em, FileImport fileImport, FileImportTracker stats) {
try {
- if (logger.isDebugEnabled()) {
- logger.debug("Adding map to {}:{} dictionary {}",
- new Object[]{ownerEntityRef.getType(), ownerEntityRef.getType(), dictionaryName});
+ if (logger.isTraceEnabled()) {
+ logger.trace("Adding map to {}:{} dictionary {}",
+ ownerEntityRef.getType(), ownerEntityRef.getType(), dictionaryName);
}
em.addMapToDictionary(ownerEntityRef, dictionaryName, dictionary);
@@ -1298,8 +1295,8 @@ public class ImportServiceImpl implements ImportService {
subscriber.onCompleted();
}
- if (logger.isDebugEnabled()) {
- logger.debug("process(): done parsing JSON");
+ if (logger.isTraceEnabled()) {
+ logger.trace("process(): done parsing JSON");
}
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
index f44902f..674596f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
@@ -120,8 +120,8 @@ public class S3ImportImpl implements S3Import {
PageSet<? extends StorageMetadata> pageSets =
blobStore.list(bucketName, new ListContainerOptions().recursive());
- if (logger.isDebugEnabled()) {
- logger.debug(" Found {} files in bucket {}", pageSets.size(), bucketName);
+ if (logger.isTraceEnabled()) {
+ logger.trace(" Found {} files in bucket {}", pageSets.size(), bucketName);
}
List<String> blobFileNames = new ArrayList<>();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java b/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java
index 94456ad..c33db9f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java
@@ -44,10 +44,10 @@ public enum AuthPrincipalType {
private synchronized static void register( AuthPrincipalType type ) {
if ( prefixes == null ) {
- prefixes = new ConcurrentHashMap<String, AuthPrincipalType>();
+ prefixes = new ConcurrentHashMap<>();
}
if ( base64Prefixes == null ) {
- base64Prefixes = new ConcurrentHashMap<String, AuthPrincipalType>();
+ base64Prefixes = new ConcurrentHashMap<>();
}
prefixes.put( type.getPrefix(), type );
base64Prefixes.put( type.getBase64Prefix(), type );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java
index 701abed..4e7e3df 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java
@@ -57,7 +57,7 @@ public class EncryptionServiceImpl implements EncryptionService {
public boolean verify( String inputSecret, CredentialsInfo creds, UUID userId, UUID applicationId ) {
- String[] storedCommands = null;
+ String[] storedCommands;
// We have the new format of crypto chain. read them and apply them
if ( creds.getCryptoChain() != null && creds.getCryptoChain().length > 0 ) {
@@ -84,8 +84,7 @@ public class EncryptionServiceImpl implements EncryptionService {
// verify we have a command to load
if ( command == null ) {
throw new IllegalArgumentException( String.format(
- "No command implementat for name %s exists, yet it is persisted on a user's credentials info."
- + " This means their credentials either need removed, or this command needs supported",
+ "No command implementation for name %s exists, yet it is persisted on a user's credentials info. This means their credentials either need to be removed, or this command needs to be supported",
commandName ) );
}
@@ -97,7 +96,6 @@ public class EncryptionServiceImpl implements EncryptionService {
}
- /** @param wiredCommands the wiredCommands to set */
@Autowired
public void setCommands( List<EncryptionCommand> inputCommands ) {
this.inputCommands = inputCommands;
@@ -112,7 +110,7 @@ public class EncryptionServiceImpl implements EncryptionService {
EncryptionCommand.class ) );
}
- commands = new HashMap<String, EncryptionCommand>();
+ commands = new HashMap<>();
/**
* Create the map by name so we can reference them later.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java b/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java
index 67529e0..f7bda45 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java
@@ -41,7 +41,7 @@ public class AccessInfo {
String state;
Long passwordChanged;
- protected Map<String, Object> properties = new TreeMap<String, Object>( String.CASE_INSENSITIVE_ORDER );
+ protected Map<String, Object> properties = new TreeMap<>( String.CASE_INSENSITIVE_ORDER );
public AccessInfo() {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java
index 24d6b9f..61924d1 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java
@@ -72,7 +72,7 @@ public abstract class AbstractProvider implements SignInAsProvider {
try {
return entityManager.getDictionaryAsMap(entityManager.getApplication(), providerKey);
} catch (Exception ex) {
- logger.error("Error in loadConfigurationFor for " + providerKey, ex);
+ logger.error("Error in loadConfigurationFor for {}", providerKey, ex);
}
return null;
}
@@ -82,7 +82,7 @@ public abstract class AbstractProvider implements SignInAsProvider {
try {
entityManager.addMapToDictionary(entityManager.getApplication(), providerKey, config);
} catch (Exception ex) {
- logger.error("Error in saveToConfiguration for " + providerKey, ex);
+ logger.error("Error in saveToConfiguration for {}", providerKey, ex);
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
index a39ebea..e86052e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
@@ -112,7 +112,7 @@ public class FacebookProvider extends AbstractProvider {
String fb_user_email = ( String ) fb_user.get( "email" );
if ( logger.isDebugEnabled() ) {
- logger.debug( JsonUtils.mapToFormattedJsonString( fb_user ) );
+ logger.debug( "FacebookProvider.createOrAuthenticate: {}", JsonUtils.mapToFormattedJsonString( fb_user ) );
}
User user = null;
@@ -128,7 +128,7 @@ public class FacebookProvider extends AbstractProvider {
throw new BadTokenException( "Could not lookup user for that Facebook ID", ex );
}
if ( r.size() > 1 ) {
- logger.error( "Multiple users for FB ID: " + fb_user_id );
+ logger.error( "Multiple users for FB ID: {}", fb_user_id );
throw new BadTokenException( "multiple users with same Facebook ID" );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
index bcefe67..324e774 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
@@ -110,7 +110,7 @@ public class FoursquareProvider extends AbstractProvider {
location.put( "longitude", ( Double ) fq_location.get( "lng" ) );
if ( logger.isDebugEnabled() ) {
- logger.debug( JsonUtils.mapToFormattedJsonString( location ) );
+ logger.debug( "FoursquareProvider.createOrAuthenticate: {}", JsonUtils.mapToFormattedJsonString( location ) );
}
// Only the first name is guaranteed to be here
@@ -129,7 +129,7 @@ public class FoursquareProvider extends AbstractProvider {
Results r = entityManager.searchCollection( entityManager.getApplicationRef(), "users", query );
if ( r.size() > 1 ) {
- logger.error( "Multiple users for FQ ID: " + fq_user_id );
+ logger.error( "Multiple users for FQ ID: {}", fq_user_id );
throw new BadTokenException( "multiple users with same Foursquare ID" );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
index 6d43fff..4381f01 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
@@ -109,7 +109,7 @@ public class Realm extends AuthorizingRealm {
public void setPermissionResolver( PermissionResolver permissionResolver ) {
if ( !( permissionResolver instanceof CustomPermissionResolver ) ) {
if (logger.isDebugEnabled()) {
- logger.debug("Replacing {} with AllowAllCredentialsMatcher", permissionResolver);
+ logger.debug("Replacing {} with CustomPermissionResolver", permissionResolver);
}
permissionResolver = new CustomPermissionResolver();
}
@@ -201,8 +201,8 @@ public class Realm extends AuthorizingRealm {
throw new AuthenticationException( "Unable to authenticate" );
}
- if (logger.isDebugEnabled()) {
- logger.debug("Authenticated: {}", principal);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Authenticated: {}", principal);
}
return new SimpleAuthenticationInfo( pcToken.getPrincipal(), pcToken.getCredentials(), getName() );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
index 03b23fa..4fe569f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
@@ -60,23 +60,16 @@ public class ShiroCache<K, V> implements Cache<K,V> {
if ( scopedCache != null ) {
V value = scopedCache.get(getKeyString(key), typeRef);
- if ( logger.isDebugEnabled() ) {
+ if ( logger.isTraceEnabled() ) {
if (value instanceof UsergridAuthorizationInfo) {
UsergridAuthorizationInfo info = (UsergridAuthorizationInfo) value;
- if (logger.isDebugEnabled()) {
- logger.debug("Got from AUTHZ cache {} for app {}", getKeyString(key), info.toString());
- }
-
+ logger.trace("Got from AUTHZ cache {} for app {}", getKeyString(key), info.toString());
} else if (value instanceof UsergridAuthenticationInfo) {
UsergridAuthenticationInfo info = (UsergridAuthenticationInfo) value;
- if (logger.isDebugEnabled()) {
- logger.debug("Got from AUTHC cache {} for app {}", getKeyString(key), info.toString());
- }
+ logger.trace("Got from AUTHC cache {} for app {}", getKeyString(key), info.toString());
} else if (value == null) {
- if (logger.isDebugEnabled()) {
- logger.debug("Got NULL from cache app {} for key {}", getKeyString(key), key.toString());
- }
+ logger.trace("Got NULL from cache app {} for key {}", getKeyString(key), key.toString());
}
}
@@ -93,14 +86,14 @@ public class ShiroCache<K, V> implements Cache<K,V> {
if ( scopedCache != null ) {
V ret = scopedCache.put(getKeyString(key), value, cacheTtl);
- if ( logger.isDebugEnabled() ) {
+ if ( logger.isTraceEnabled() ) {
if (value instanceof UsergridAuthorizationInfo) {
UsergridAuthorizationInfo info = (UsergridAuthorizationInfo) value;
- logger.debug("Put to AUTHZ cache {} for app {}", getKeyString(key), info.toString());
+ logger.trace("Put to AUTHZ cache {} for app {}", getKeyString(key), info.toString());
} else if (value instanceof UsergridAuthenticationInfo) {
UsergridAuthenticationInfo info = (UsergridAuthenticationInfo) value;
- logger.debug("Put to AUTHC cache {} for app {}", getKeyString(key), info.toString());
+ logger.trace("Put to AUTHC cache {} for app {}", getKeyString(key), info.toString());
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java
index 17d5cce..a3c3062 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java
@@ -80,7 +80,7 @@ public class ShiroCacheManager implements CacheManager {
getCacheTtl());
} else {
- logger.error("Unknown Shiro Cache name: " + name);
+ logger.error("Unknown Shiro Cache name: {}", name);
throw new RuntimeException("Unknown Shiro Cache name: " + name);
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java
index b1bf749..41a1d0d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java
@@ -84,16 +84,16 @@ public abstract class PrincipalIdentifier {
protected void grant( UsergridAuthorizationInfo info, String permission ) {
- if (logger.isDebugEnabled()) {
- logger.debug("Principal {} granted permission: {}", this, permission);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Principal {} granted permission: {}", this, permission);
}
info.addStringPermission(permission);
}
protected void role( UsergridAuthorizationInfo info, String role ) {
- if (logger.isDebugEnabled()) {
- logger.debug("Principal {} added to role: {}", this, role);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Principal {} added to role: {}", this, role);
}
info.addRole(role);
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java
index ac4be06..3b4b37d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java
@@ -429,8 +429,8 @@ public class SubjectUtils {
currentUser.checkPermission( permission );
}
catch ( org.apache.shiro.authz.UnauthenticatedException e ) {
- if (logger.isDebugEnabled()) {
- logger.debug("checkPermission(): Subject is anonymous");
+ if (logger.isTraceEnabled()) {
+ logger.trace("checkPermission(): Subject is anonymous");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java b/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java
index 121901d..f5a2e03 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java
@@ -38,10 +38,10 @@ public enum TokenCategory {
private synchronized static void register( TokenCategory type ) {
if ( prefixes == null ) {
- prefixes = new ConcurrentHashMap<String, TokenCategory>();
+ prefixes = new ConcurrentHashMap<>();
}
if ( base64Prefixes == null ) {
- base64Prefixes = new ConcurrentHashMap<String, TokenCategory>();
+ base64Prefixes = new ConcurrentHashMap<>();
}
prefixes.put( type.getPrefix(), type );
base64Prefixes.put( type.getBase64Prefix(), type );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
index 42906c6..fbb4cc6 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
@@ -94,8 +94,8 @@ public class AbstractCollectionService extends AbstractService {
}
if ( entity == null ) {
- if (logger.isDebugEnabled()) {
- logger.debug("miss on entityType: {} with uuid: {}", getEntityType(), id);
+ if (logger.isTraceEnabled()) {
+ logger.trace("miss on entityType: {} with uuid: {}", getEntityType(), id);
}
String msg = "Cannot find entity associated with uuid: " + id;
throw new EntityNotFoundException( msg );
@@ -120,9 +120,9 @@ public class AbstractCollectionService extends AbstractService {
// the context of the entity they're trying to load isn't owned by the owner
// in the path, don't return it
if ( !em.isCollectionMember( context.getOwner(), context.getCollectionName(), entity ) ) {
- logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}", new Object[] {
+ logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}",
getEntityType(), id, context.getOwner()
- } );
+ );
throw new ServiceResourceNotFoundException( context );
}
@@ -153,8 +153,8 @@ public class AbstractCollectionService extends AbstractService {
if ( entity == null ) {
- if (logger.isDebugEnabled()) {
- logger.debug("miss on entityType: {} with name: {}", getEntityType(), name);
+ if (logger.isTraceEnabled()) {
+ logger.trace("miss on entityType: {} with name: {}", getEntityType(), name);
}
String msg = "Cannot find entity with name: "+name;
@@ -164,9 +164,9 @@ public class AbstractCollectionService extends AbstractService {
// the context of the entity they're trying to load isn't owned by the owner
// in the path, don't return it
if ( !em.isCollectionMember( context.getOwner(), context.getCollectionName(), entity ) ) {
- logger.info( "Someone tried to GET entity {} they don't own. Entity name {} with owner {}", new Object[] {
+ logger.info( "Someone tried to GET entity {} they don't own. Entity name {} with owner {}",
getEntityType(), name, context.getOwner()
- } );
+ );
throw new ServiceResourceNotFoundException( context );
}
@@ -246,8 +246,8 @@ public class AbstractCollectionService extends AbstractService {
return getItemsByQuery( context, new Query() );
}
- if (logger.isDebugEnabled()) {
- logger.debug("Limiting collection to " + Query.DEFAULT_LIMIT);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Limiting collection to {}", Query.DEFAULT_LIMIT);
}
int count = Query.DEFAULT_LIMIT;
@@ -356,16 +356,16 @@ public class AbstractCollectionService extends AbstractService {
List<Entity> entities = new ArrayList<Entity>();
List<Map<String, Object>> batch = context.getPayload().getBatchProperties();
- if (logger.isDebugEnabled()) {
- logger.debug("Attempting to batch create " + batch.size() + " entities in collection " + context
- .getCollectionName());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Attempting to batch create {} entities in collection {}",
+ batch.size(), context.getCollectionName());
}
int i = 1;
for ( Map<String, Object> p : batch ) {
- if (logger.isDebugEnabled()) {
- logger.debug("Creating entity " + i + " in collection " + context.getCollectionName());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Creating entity {} in collection {}", i, context.getCollectionName());
}
Entity item = null;
@@ -377,17 +377,16 @@ public class AbstractCollectionService extends AbstractService {
catch ( Exception e ) {
// TODO should we not log this as error?
if (logger.isDebugEnabled()) {
- logger.debug("Entity " + i + " unable to be created in collection " + context.getCollectionName(),
+ logger.debug("Entity {} unable to be created in collection {}", i, context.getCollectionName(),
e);
}
i++;
continue;
}
- if (logger.isDebugEnabled()) {
- logger.debug(
- "Entity " + i + " created in collection " + context.getCollectionName() + " with UUID " + item
- .getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace(
+ "Entity {} created in collection {} with UUID {}", i, context.getCollectionName(), item.getUuid());
}
item = importEntity( context, item );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
index ca539e0..94b25d3 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
@@ -218,9 +218,9 @@ public class AbstractConnectionsService extends AbstractService {
// the context of the entity they're trying to load isn't owned by the owner
// in the path, don't return it
if ( !em.isConnectionMember( context.getOwner(), context.getCollectionName(), entity ) ) {
- logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}", new Object[] {
+ logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}",
getEntityType(), id, context.getOwner()
- } );
+ );
throw new ServiceResourceNotFoundException( context );
}
@@ -286,8 +286,8 @@ public class AbstractConnectionsService extends AbstractService {
count = Query.MAX_LIMIT;
level = Level.ALL_PROPERTIES;
- if (logger.isDebugEnabled()) {
- logger.debug("Query does not have more parameters, overwriting limit to: {} and level to {}" ,
+ if (logger.isTraceEnabled()) {
+ logger.trace("Query does not have more parameters, overwriting limit to: {} and level to {}" ,
count, level.name());
}
}
@@ -306,8 +306,8 @@ public class AbstractConnectionsService extends AbstractService {
if ( connecting() ) {
if ( query.hasQueryPredicates() ) {
- if (logger.isDebugEnabled()) {
- logger.debug("Attempted query of backwards connections");
+ if (logger.isTraceEnabled()) {
+ logger.trace("Attempted query of backwards connections");
}
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
index 8bd02ea..2d5b7e1 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
@@ -95,14 +95,18 @@ public class AbstractPathBasedColllectionService extends AbstractCollectionServi
}
}
if ( !isEmpty( aliases ) ) {
- logger.info( "Found {} potential paths", aliases.size() );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Found {} potential paths", aliases.size());
+ }
Map<String, EntityRef> aliasedEntities = em.getAlias( getEntityType(), aliases );
for ( int i = aliases.size() - 1; i >= 0; i-- ) {
alias = aliases.get( i );
pathEntity = aliasedEntities.get( alias );
if ( pathEntity != null ) {
- logger.info( "Found entity {} of type {} for alias {}",
- new Object[] { pathEntity.getUuid(), pathEntity.getType(), alias } );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Found entity {} of type {} for alias {}",
+ pathEntity.getUuid(), pathEntity.getType(), alias);
+ }
parameters = parameters.subList( i + 1, parameters.size() );
first_parameter = new IdParameter( pathEntity.getUuid() );
// if (!isEmpty(parameters)) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
index 8dd9afa..5d818cc 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
@@ -560,7 +560,7 @@ public abstract class AbstractService implements Service {
entity.addProperties( payload.getProperties() );
return entity;
}
- logger.error("Attempted update of entity reference rather than full entity, currently unsupport - MUSTFIX");
+ logger.error("Attempted update of entity reference rather than full entity, currently unsupported");
throw new NotImplementedException();
}
@@ -1365,7 +1365,7 @@ public abstract class AbstractService implements Service {
boolean permitted = currentUser.isPermitted( perm );
if ( logger.isDebugEnabled() ) {
- logger.debug( PATH_MSG, new Object[] { path, context.getAction(), perm, permitted } );
+ logger.debug( PATH_MSG, path, context.getAction(), perm, permitted );
}
SubjectUtils.checkPermission( perm );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java
index eb65c0e..4f6ce2f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java
@@ -256,7 +256,7 @@ public class ServiceInfo {
return servicePatternCache.get( servicePattern );
}
catch ( ExecutionException ee ) {
- logger.error("Error in getClassName for service pattern: "+servicePattern, ee);
+ logger.error("Error in getClassName for service pattern: {}", servicePattern, ee);
}
return _getClassName( servicePattern );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java
index b428229..c439b49 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java
@@ -107,7 +107,7 @@ public class ServiceManager {
applicationId = application.getUuid();
}
catch ( Exception e ) {
- logger.error( "This should never happen", e );
+ logger.error( "ServiceManager init failure", e );
throw new RuntimeException( e );
}
}
@@ -210,8 +210,8 @@ public class ServiceManager {
return null;
}
- if (logger.isDebugEnabled()) {
- logger.debug("Looking up service pattern: {}", serviceType);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Looking up service pattern: {}", serviceType);
}
ServiceInfo info = ServiceInfo.getServiceInfo( serviceType );
@@ -223,8 +223,8 @@ public class ServiceManager {
Service service = getServiceInstance( info );
if ( service != null ) {
- if (logger.isDebugEnabled()) {
- logger.debug("Returning service instance: {}", service.getClass());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Returning service instance: {}", service.getClass());
}
}
@@ -280,8 +280,8 @@ public class ServiceManager {
Class<Service> cls;
try {
- if (logger.isDebugEnabled()) {
- logger.debug("Attempting to instantiate service class {}", classname);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Attempting to instantiate service class {}", classname);
}
cls = ( Class<Service> ) Class.forName( classname );
if ( cls.isInterface() ) {
@@ -328,7 +328,7 @@ public class ServiceManager {
s = cls.newInstance();
}
catch ( Exception e ) {
- logger.error( "cannot instantiate " + cls.getName(), e );
+ logger.error( "cannot instantiate {}", cls.getName(), e );
}
if ( s instanceof AbstractService ) {
AbstractService as = ( ( AbstractService ) s );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java
index 6e8a072..533992b 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java
@@ -127,7 +127,7 @@ public abstract class ServiceParameter {
public static List<ServiceParameter> addParameter( List<ServiceParameter> parameters, Query query ) {
if ( parameters == null ) {
- parameters = new ArrayList<ServiceParameter>();
+ parameters = new ArrayList<>();
}
if ( query == null ) {
@@ -135,7 +135,7 @@ public abstract class ServiceParameter {
}
if ( lastParameterIsQuery( parameters ) ) {
- logger.error( "Adding two queries in a row" );
+ logger.info( "Adding two queries in a row" );
}
ServiceParameter p = new QueryParameter( query );
@@ -148,7 +148,7 @@ public abstract class ServiceParameter {
throws Exception {
if ( parameters == null ) {
- parameters = new ArrayList<ServiceParameter>();
+ parameters = new ArrayList<>();
}
if ( params == null ) {
@@ -177,59 +177,37 @@ public abstract class ServiceParameter {
public static boolean firstParameterIsName( List<ServiceParameter> parameters ) {
- if ( !isEmpty( parameters ) ) {
- return parameters.get( 0 ).isName();
- }
- return false;
+ return !isEmpty(parameters) && parameters.get( 0 ).isName();
}
public static boolean lastParameterIsName( List<ServiceParameter> parameters ) {
- if ( !isEmpty( parameters ) ) {
- return parameters.get( parameters.size() - 1 ).isName();
- }
- return false;
+ return !isEmpty(parameters) && parameters.get( parameters.size() - 1 ).isName();
}
public static boolean firstParameterIsQuery( List<ServiceParameter> parameters ) {
- if ( !isEmpty( parameters ) ) {
- return parameters.get( 0 ).isQuery();
- }
- return false;
+ return !isEmpty(parameters) && parameters.get( 0 ).isQuery();
}
public static boolean lastParameterIsQuery( List<ServiceParameter> parameters ) {
- if ( !isEmpty( parameters ) ) {
- return parameters.get( parameters.size() - 1 ).isQuery();
- }
- return false;
+ return !isEmpty(parameters) && parameters.get( parameters.size() - 1 ).isQuery();
}
public static boolean firstParameterIsId( List<ServiceParameter> parameters ) {
- if ( !isEmpty( parameters ) ) {
- return parameters.get( 0 ).isId();
- }
- return false;
+ return !isEmpty(parameters) && parameters.get(0).isId();
}
public static boolean lastParameterIsId( List<ServiceParameter> parameters ) {
- if ( !isEmpty( parameters ) ) {
- return parameters.get( parameters.size() - 1 ).isId();
- }
- return false;
+ return !isEmpty(parameters) && parameters.get( parameters.size() - 1 ).isId();
}
public static ServiceParameter firstParameter( List<ServiceParameter> parameters ) {
- if ( !isEmpty( parameters ) ) {
- return parameters.get( 0 );
- }
-
- return null;
+ return !isEmpty(parameters) ? parameters.get(0) : null;
}
@@ -329,7 +307,7 @@ public abstract class ServiceParameter {
if ( !found ) {
continue;
}
- ArrayList<ServiceParameter> p = new ArrayList<ServiceParameter>();
+ ArrayList<ServiceParameter> p = new ArrayList<>();
for ( String name : replaceSet.getValue() ) {
if ( name.startsWith( "\\" ) ) {
int i = Integer.parseInt( name.substring( 1 ) );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java
index de3c012..868cb68 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java
@@ -73,8 +73,8 @@ public class ServiceResults extends Results {
}
this.serviceMetadata = serviceMetadata;
this.nextRequests = nextRequests;
- if (logger.isDebugEnabled()) {
- logger.debug("Child path: {}", childPath);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Child path: {}", childPath);
}
}
@@ -95,8 +95,8 @@ public class ServiceResults extends Results {
}
this.serviceMetadata = serviceMetadata;
this.nextRequests = nextRequests;
- if (logger.isDebugEnabled()) {
- logger.debug("Child path: {}", childPath);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Child path: {}", childPath);
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java b/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java
index 02105bf..348b442 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java
@@ -29,8 +29,8 @@ public class ActivitiesService extends AbstractCollectionService {
public ActivitiesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/activities");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/activities");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
index 515721a..ae524c6 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
@@ -49,8 +49,8 @@ public class ApplicationsService extends AbstractService {
public ApplicationsService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/applications");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/applications");
}
declareEntityDictionary( "counters" );
declareEntityCommand( "hello" );
@@ -149,7 +149,7 @@ public class ApplicationsService extends AbstractService {
em.createApplicationCollection( collection );
if (logger.isDebugEnabled()) {
- logger.debug("Created collection " + collection + " for application " + sm.getApplicationId());
+ logger.debug("Created collection {} for application {}", collection, sm.getApplicationId());
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java
index f313e4a..41aaa82 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java
@@ -34,8 +34,8 @@ public class AssetsService extends AbstractPathBasedColllectionService {
public AssetsService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/assets");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/assets");
}
declareServiceCommands( "data" );
}
@@ -44,8 +44,8 @@ public class AssetsService extends AbstractPathBasedColllectionService {
@Override
public ServiceResults getEntityCommand( ServiceContext context, List<EntityRef> refs, String command )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("handling command: {}", command);
+ if (logger.isTraceEnabled()) {
+ logger.trace("handling command: {}", command);
}
ServiceResults sr = ServiceResults.genericServiceResults();
@@ -56,8 +56,8 @@ public class AssetsService extends AbstractPathBasedColllectionService {
@Override
public ServiceResults getServiceCommand( ServiceContext context, String command ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("in getServiceCommand with command: {}", command);
+ if (logger.isTraceEnabled()) {
+ logger.trace("in getServiceCommand with command: {}", command);
}
return ServiceResults.genericServiceResults();
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java
index 1ecc9e7..b1822ea 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java
@@ -37,7 +37,7 @@ import org.apache.tika.mime.MediaType;
/** Detect the mime type of an Asset */
public final class AssetMimeHandler {
- private static final Logger LOG = LoggerFactory.getLogger( AssetMimeHandler.class );
+ private static final Logger logger = LoggerFactory.getLogger( AssetMimeHandler.class );
private Detector detector;
@@ -98,7 +98,7 @@ public final class AssetMimeHandler {
fileMetadata.put( AssetUtils.CONTENT_TYPE, mediaType.toString() );
}
catch ( IOException e ) {
- LOG.error( "error detecting mime type", e );
+ logger.error( "error detecting mime type", e );
}
return mediaType.toString();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java
index 91ad9cc..48ad1ba 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java
@@ -34,7 +34,7 @@ import com.google.common.base.Preconditions;
public class AssetUtils {
- private static final Logger LOG = LoggerFactory.getLogger( AssetUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( AssetUtils.class );
public static final String FILE_METADATA = "file-metadata";
public static final String CONTENT_TYPE = "content-type";
@@ -62,7 +62,7 @@ public class AssetUtils {
moded = DateUtils.parseDate( headerValue, DEFAULT_PATTERNS );
}
catch ( ParseException pe ) {
- LOG.error( "Could not parse date format from If-Modified-Since header: " + headerValue );
+ logger.error( "Could not parse date format from If-Modified-Since header: {}", headerValue );
}
}
return moded;
[7/7] usergrid git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/usergrid into USERGRID-1243
Posted by mr...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/usergrid into USERGRID-1243
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/47a86701
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/47a86701
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/47a86701
Branch: refs/heads/master
Commit: 47a86701ec020c28e84bf5483a66618f730a64dc
Parents: 54e62f9 4aac68e
Author: Mike Dunker <md...@apigee.com>
Authored: Mon Feb 1 14:33:43 2016 -0800
Committer: Mike Dunker <md...@apigee.com>
Committed: Mon Feb 1 14:33:43 2016 -0800
----------------------------------------------------------------------
.../main/resources/usergrid-default.properties | 5 +
.../rx/impl/AllApplicationsObservable.java | 2 -
.../org/apache/usergrid/utils/MailUtils.java | 2 +-
stack/corepersistence/common/pom.xml | 2 +-
.../astyanax/MultiKeyColumnNameIterator.java | 4 +-
stack/corepersistence/pom.xml | 112 ++++++------
stack/corepersistence/queue/pom.xml | 179 ++++++++++---------
.../java-wns/1.2-USERGRID/_remote.repositories | 7 -
...a-wns-1.2-USERGRID-jar-with-dependencies.jar | Bin 1836665 -> 0 bytes
.../java-wns-1.2-USERGRID-javadoc.jar | Bin 234289 -> 0 bytes
.../java-wns-1.2-USERGRID-sources.jar | Bin 21654 -> 0 bytes
.../1.2-USERGRID/java-wns-1.2-USERGRID.jar | Bin 33164 -> 0 bytes
.../1.2-USERGRID/java-wns-1.2-USERGRID.pom | 128 -------------
stack/pom.xml | 12 --
.../usergrid/rest/AbstractContextResource.java | 52 +++++-
.../rest/applications/ApplicationResource.java | 10 +-
.../rest/applications/ServiceResource.java | 12 +-
.../rest/applications/users/UserResource.java | 41 ++---
.../rest/applications/users/UsersResource.java | 14 +-
.../rest/management/ManagementResource.java | 5 +-
.../organizations/OrganizationResource.java | 14 +-
.../rest/management/users/UserResource.java | 66 ++++---
.../applications/assets/AwsAssetResourceIT.java | 1 -
stack/services/pom.xml | 18 +-
.../usergrid/management/ManagementService.java | 13 ++
.../usergrid/management/OrganizationConfig.java | 27 +--
.../management/OrganizationConfigProps.java | 4 +
.../cassandra/ManagementServiceImpl.java | 54 +++++-
.../cassandra/OrganizationConfigPropsImpl.java | 45 ++++-
.../management/export/S3ExportImpl.java | 1 -
.../management/importer/S3ImportImpl.java | 2 -
.../assets/data/AwsSdkS3BinaryStore.java | 7 -
.../usergrid/management/importer/S3Upload.java | 1 -
stack/tools/pom.xml | 12 ++
34 files changed, 438 insertions(+), 414 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java
----------------------------------------------------------------------
diff --cc stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java
index da41b59,1d86631..77d2d1e
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/AbstractContextResource.java
@@@ -180,12 -227,11 +227,11 @@@ public abstract class AbstractContextRe
sendRedirect(redirect_url);
}
- if (logger.isDebugEnabled()) {
- logger.debug("Dispatching to viewable with template: {}", template, template_property);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Dispatching to viewable with template: {} property: {}", template, template_property);
}
- Viewable viewable = new Viewable(template, model);
- return viewable;
+ return new Viewable(template, model);
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ApplicationResource.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UserResource.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/rest/src/main/java/org/apache/usergrid/rest/applications/users/UsersResource.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/OrganizationResource.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/rest/src/main/java/org/apache/usergrid/rest/management/users/UserResource.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/47a86701/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java
----------------------------------------------------------------------
[5/7] usergrid git commit: USERGRID-1243: logging overhaul, pt. 2
Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java
index 47a99c0..458d9a5 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java
@@ -105,7 +105,7 @@ public class AwsSdkS3BinaryStore implements BinaryStore {
this.bucketName = properties.getProperty( "usergrid.binary.bucketname" );
if(bucketName == null){
- logger.error( "usergrid.binary.bucketname not properly set so amazon bucket is null" );
+ logger.error( "usergrid.binary.bucketname not properly set so amazon bucket is null" );
throw new AwsPropertiesNotFoundException( "usergrid.binary.bucketname" );
}
@@ -213,7 +213,7 @@ public class AwsSdkS3BinaryStore implements BinaryStore {
if(written> maxSizeBytes){
overSizeLimit = true;
- logger.error( "OVERSIZED FILE. STARTING ABORT" );
+ logger.error( "OVERSIZED FILE ({}). STARTING ABORT", written );
break;
//set flag here and break out of loop to run abort
}
@@ -268,7 +268,7 @@ public class AwsSdkS3BinaryStore implements BinaryStore {
timesIterated--;
listResult = getS3Client().listMultipartUploads( listRequest );
if (logger.isDebugEnabled()) {
- logger.debug("Files that haven't been aborted are: ", listResult.getMultipartUploads().listIterator().toString());
+ logger.debug("Files that haven't been aborted are: {}", listResult.getMultipartUploads().listIterator().toString());
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/data/LocalFileBinaryStore.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/LocalFileBinaryStore.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/LocalFileBinaryStore.java
index b167d13..d829016 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/LocalFileBinaryStore.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/LocalFileBinaryStore.java
@@ -39,7 +39,7 @@ import java.util.UUID;
/** A binary store implementation using the local file system */
public class LocalFileBinaryStore implements BinaryStore {
- private static final Logger LOG = LoggerFactory.getLogger( LocalFileBinaryStore.class );
+ private static final Logger logger = LoggerFactory.getLogger( LocalFileBinaryStore.class );
private String reposLocation = FileUtils.getTempDirectoryPath();
@@ -102,7 +102,7 @@ public class LocalFileBinaryStore implements BinaryStore {
em.update( entity );
} catch ( Exception e ) {
- LOG.error( "Error updating entity with error message", e);
+ logger.error( "Error updating entity with error message", e);
}
return;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/data/S3BinaryStore.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/S3BinaryStore.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/S3BinaryStore.java
index 8c5c180..2929d93 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/S3BinaryStore.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/S3BinaryStore.java
@@ -54,7 +54,7 @@ public class S3BinaryStore implements BinaryStore {
private static final Iterable<? extends Module> MODULES = ImmutableSet
.of( new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule() );
- private static final Logger LOG = LoggerFactory.getLogger( S3BinaryStore.class );
+ private static final Logger logger = LoggerFactory.getLogger( S3BinaryStore.class );
private static final long FIVE_MB = ( FileUtils.ONE_MB * 5 );
private static String WORKERS_PROP_NAME = "usergrid.binary.upload-workers";
@@ -158,7 +158,7 @@ public class S3BinaryStore implements BinaryStore {
if ( StringUtils.isNumeric( workersString ) ) {
workers = Integer.parseInt( workersString );
} else if ( !StringUtils.isEmpty( workersString )) {
- LOG.error("Ignoring invalid setting for {}", WORKERS_PROP_NAME);
+ logger.error("Ignoring invalid setting for {}", WORKERS_PROP_NAME);
}
executorService = Executors.newFixedThreadPool( workers );
}
@@ -218,8 +218,8 @@ public class S3BinaryStore implements BinaryStore {
@Override
public Void call() {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Writing temp file for S3 upload");
+ if (logger.isTraceEnabled()) {
+ logger.trace("Writing temp file for S3 upload");
}
// determine max size file allowed, default to 50mb
@@ -245,8 +245,8 @@ public class S3BinaryStore implements BinaryStore {
written += data.length;
written += IOUtils.copyLarge( inputStream, os, 0, maxSizeBytes + 1 );
- if (LOG.isDebugEnabled()) {
- LOG.debug("Write temp file {} length {}", tempFile.getName(), written);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Write temp file {} length {}", tempFile.getName(), written);
}
} catch ( IOException e ) {
@@ -257,7 +257,7 @@ public class S3BinaryStore implements BinaryStore {
try {
os.flush();
} catch (IOException e) {
- LOG.error( "Error flushing data to temporary upload file", e );
+ logger.error( "Error flushing data to temporary upload file", e );
}
IOUtils.closeQuietly( os );
}
@@ -268,9 +268,9 @@ public class S3BinaryStore implements BinaryStore {
Map<String, Object> fileMetadata = AssetUtils.getFileMetadata( entity );
if ( tempFile.length() > maxSizeBytes ) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("File too large. Temp file size (bytes) = {}, " +
- "Max file size (bytes) = {} ", tempFile.length(), maxSizeBytes);
+ if (logger.isDebugEnabled()) {
+ logger.debug("File too large. Temp file size (bytes) = {}, Max file size (bytes) = {}",
+ tempFile.length(), maxSizeBytes);
}
try {
EntityManager em = emf.getEntityManager( appId );
@@ -280,7 +280,7 @@ public class S3BinaryStore implements BinaryStore {
tempFile.delete();
} catch ( Exception e ) {
- LOG.error( "Error updating entity with error message", e);
+ logger.error( "Error updating entity with error message", e);
}
return null;
}
@@ -290,8 +290,8 @@ public class S3BinaryStore implements BinaryStore {
try { // start the upload
- if (LOG.isDebugEnabled()) {
- LOG.debug("S3 upload thread started");
+ if (logger.isTraceEnabled()) {
+ logger.trace("S3 upload thread started");
}
BlobStore blobStore = getContext().getBlobStore();
@@ -314,14 +314,14 @@ public class S3BinaryStore implements BinaryStore {
String md5sum = Hex.encodeHexString( blob.getMetadata().getContentMetadata().getContentMD5() );
fileMetadata.put( AssetUtils.CHECKSUM, md5sum );
- if (LOG.isDebugEnabled()) {
- LOG.debug("S3 upload starting");
+ if (logger.isTraceEnabled()) {
+ logger.trace("S3 upload starting");
}
String eTag = blobStore.putBlob( bucketName, blob );
- if (LOG.isDebugEnabled()) {
- LOG.debug("S3 upload complete eTag=" + eTag);
+ if (logger.isTraceEnabled()) {
+ logger.trace("S3 upload complete eTag=" + eTag);
}
// update entity with eTag
@@ -332,7 +332,7 @@ public class S3BinaryStore implements BinaryStore {
em.update( entity );
}
catch ( Exception e ) {
- LOG.error( "error uploading", e );
+ logger.error( "error uploading", e );
}
if ( tempFile != null && tempFile.exists() ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java b/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java
index 7404dca..f57a03a 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/devices/DevicesService.java
@@ -44,16 +44,16 @@ public class DevicesService extends AbstractCollectionService {
public DevicesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/devices");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/devices");
}
}
@Override
public ServiceResults putItemById( ServiceContext context, UUID id ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("Registering device {}", id);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Registering device {}", id);
}
return super.putItemById( context, id );
}
@@ -61,7 +61,9 @@ public class DevicesService extends AbstractCollectionService {
@Override
public ServiceResults postItemById( ServiceContext context, UUID id ) throws Exception {
- logger.info("Attempting to connect an entity to device {}", id);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Attempting to connect an entity to device {}", id);
+ }
return super.postItemById( context, id );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/devices/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/devices/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/devices/notifications/NotificationsService.java
index c766c72..8999f05 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/devices/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/devices/notifications/NotificationsService.java
@@ -26,7 +26,9 @@ public class NotificationsService extends
.getLogger(NotificationsService.class);
public NotificationsService() {
- logger.info("/devices/*/notifications");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/devices/*/notifications");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java
index c8ac153..01012aa 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/GroupsService.java
@@ -51,8 +51,8 @@ public class GroupsService extends AbstractPathBasedColllectionService {
public GroupsService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/groups");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/groups");
}
// rolenames is the one case of Entity Dictionary name not equal to path segment
@@ -71,8 +71,8 @@ public class GroupsService extends AbstractPathBasedColllectionService {
throw new IllegalArgumentException( "You must provide a 'path' property when creating a group" );
}
- if (logger.isDebugEnabled()) {
- logger.debug("Creating group with path {}", path);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Creating group with path {}", path);
}
Preconditions.checkArgument( matcher.matchesAllOf( path ), "Illegal characters found in group name: " + path );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java
index bed22aa..4b04edf 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/activities/ActivitiesService.java
@@ -38,8 +38,8 @@ public class ActivitiesService extends GenericCollectionService {
public ActivitiesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/groups/*/activities");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/groups/*/activities");
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/groups/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/notifications/NotificationsService.java
index 9e965b5..e5949ef 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/notifications/NotificationsService.java
@@ -26,7 +26,9 @@ public class NotificationsService extends
.getLogger(NotificationsService.class);
public NotificationsService() {
- logger.info("/groups/*/notifications");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/groups/*/notifications");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/groups/roles/RolesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/roles/RolesService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/roles/RolesService.java
index e01d15f..4915e51 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/roles/RolesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/roles/RolesService.java
@@ -28,8 +28,8 @@ public class RolesService extends org.apache.usergrid.services.roles.RolesServic
public RolesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/groups/*/roles");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/groups/*/roles");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/groups/users/UsersService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/UsersService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/UsersService.java
index c3fd452..cb9709f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/UsersService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/UsersService.java
@@ -28,8 +28,8 @@ public class UsersService extends org.apache.usergrid.services.users.UsersServic
public UsersService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/groups/*/users");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/groups/*/users");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java
index d815c10..7de9d8e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/activities/ActivitiesService.java
@@ -40,8 +40,8 @@ public class ActivitiesService extends GenericCollectionService {
public ActivitiesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/groups/*/users/*/activities");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/groups/*/users/*/activities");
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/DevicesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/DevicesService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/DevicesService.java
index e9f8845..8ab4b67 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/DevicesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/DevicesService.java
@@ -28,8 +28,8 @@ public class DevicesService extends org.apache.usergrid.services.devices.Devices
public DevicesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/groups/*/users/*/devices");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/groups/*/users/*/devices");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/notifications/NotificationsService.java
index 7587bd0..1a432c8 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/groups/users/devices/notifications/NotificationsService.java
@@ -26,7 +26,9 @@ public class NotificationsService extends
.getLogger(NotificationsService.class);
public NotificationsService() {
- logger.info("/groups/*/users/*/devices/*/notifications");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/groups/*/users/*/devices/*/notifications");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/messages/MessagesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/messages/MessagesService.java b/stack/services/src/main/java/org/apache/usergrid/services/messages/MessagesService.java
index e55c9b2..53c2475 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/messages/MessagesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/messages/MessagesService.java
@@ -29,8 +29,8 @@ public class MessagesService extends AbstractCollectionService {
public MessagesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/messages");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/messages");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java
index 2ce381d..836bfc7 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueMessage.java
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
public class ApplicationQueueMessage implements Serializable {
- private static final Logger log = LoggerFactory.getLogger(ApplicationQueueMessage.class);
+ private static final Logger logger = LoggerFactory.getLogger(ApplicationQueueMessage.class);
private UUID applicationId;
private UUID notificationId;
private UUID deviceId;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java
index 5ab16ba..37650c5 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/InactiveDeviceManager.java
@@ -37,7 +37,7 @@ import java.util.Map;
* remove inactive devices.
*/
public class InactiveDeviceManager {
- private static final Logger LOG = LoggerFactory.getLogger(InactiveDeviceManager.class);
+ private static final Logger logger = LoggerFactory.getLogger(InactiveDeviceManager.class);
private final Notifier notifier;
private EntityManager entityManager;
@@ -48,8 +48,8 @@ public class InactiveDeviceManager {
public void removeInactiveDevices( Map<String,Date> inactiveDeviceMap ){
final String notfierPostFix = ApplicationQueueManagerImpl.NOTIFIER_ID_POSTFIX;
if (inactiveDeviceMap != null && inactiveDeviceMap.size() > 0) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("processing {} inactive devices", inactiveDeviceMap.size());
+ if (logger.isDebugEnabled()) {
+ logger.debug("processing {} inactive devices", inactiveDeviceMap.size());
}
Map<String, Object> clearPushtokenMap = new HashMap<String, Object>( 2);
clearPushtokenMap.put(notifier.getName() + notfierPostFix, "");
@@ -71,7 +71,7 @@ public class InactiveDeviceManager {
entityManager.updateProperties(e, clearPushtokenMap);
}
}catch (Exception e){
- LOG.error("failed to remove token",e);
+ logger.error("failed to remove token",e);
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/JobScheduler.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/JobScheduler.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/JobScheduler.java
index f9fe8b8..0f40d66 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/JobScheduler.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/JobScheduler.java
@@ -46,7 +46,9 @@ public class JobScheduler{
SchedulerService scheduler = getSchedulerService();
scheduler.createJob("notificationBatchJob", soonestPossible, jobData);
- logger.info("notification {} batch scheduled for delivery", notification.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} batch scheduled for delivery", notification.getUuid());
+ }
}
public boolean scheduleQueueJob(Notification notification) throws Exception {
return scheduleQueueJob(notification,false);
@@ -70,7 +72,9 @@ public class JobScheduler{
jobData.setProperty("deliver", notification.getDeliver());
SchedulerService scheduler = getSchedulerService();
scheduler.createJob("queueJob", scheduleAt, jobData);
- logger.info("notification {} scheduled for queuing", notification.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} scheduled for queuing", notification.getUuid());
+ }
}
return scheduled;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
index ee4a491..bbdec7a 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
@@ -86,7 +86,9 @@ public class NotificationsService extends AbstractCollectionService {
private QueueManagerFactory queueManagerFactory;
public NotificationsService() {
- logger.info("/notifications");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/notifications");
+ }
}
@Override
@@ -129,7 +131,9 @@ public class NotificationsService extends AbstractCollectionService {
@Override
public ServiceResults postCollection(ServiceContext context) throws Exception {
- logger.info("NotificationService: start request.");
+ if (logger.isTraceEnabled()) {
+ logger.trace("NotificationService: start request.");
+ }
Timer.Context timer = postTimer.time();
postMeter.mark();
try {
@@ -149,12 +153,16 @@ public class NotificationsService extends AbstractCollectionService {
properties.put("started", notification.getStarted());
properties.put("state", notification.getState());
notification.addProperties(properties);
- logger.info("ApplicationQueueMessage: notification {} properties updated in duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
+ if (logger.isTraceEnabled()) {
+ logger.trace("ApplicationQueueMessage: notification {} properties updated in duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
+ }
}
long now = System.currentTimeMillis();
notificationQueueManager.queueNotification(notification, null);
- logger.info("NotificationService: notification {} post queue duration {} ms ", notification.getUuid(), System.currentTimeMillis() - now);
+ if (logger.isTraceEnabled()) {
+ logger.trace("NotificationService: notification {} post queue duration {} ms ", notification.getUuid(), System.currentTimeMillis() - now);
+ }
// future: somehow return 202?
return results;
}catch (Exception e){
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java
index c6f4a17..245a36f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java
@@ -63,7 +63,9 @@ public class QueueJob extends OnlyOnceJob {
public QueueJob() {
- logger.info( "QueueJob created: " + this );
+ if (logger.isTraceEnabled()) {
+ logger.trace( "QueueJob created" );
+ }
}
@@ -80,7 +82,9 @@ public class QueueJob extends OnlyOnceJob {
public void doJob( JobExecution jobExecution ) throws Exception {
Timer.Context timer = execution.time();
requests.mark();
- logger.info( "execute QueueJob {}", jobExecution );
+ if (logger.isTraceEnabled()) {
+ logger.trace("execute QueueJob {}", jobExecution);
+ }
JobData jobData = jobExecution.getJobData();
UUID applicationId = ( UUID ) jobData.getProperty( "applicationId" );
@@ -97,7 +101,9 @@ public class QueueJob extends OnlyOnceJob {
UUID notificationId = ( UUID ) jobData.getProperty( "notificationId" );
Notification notification = em.get( notificationId, Notification.class );
if ( notification == null ) {
- logger.info( "notificationId {} no longer exists", notificationId );
+ if (logger.isDebugEnabled()) {
+ logger.trace("notificationId {} no longer exists", notificationId);
+ }
return;
}
@@ -118,7 +124,9 @@ public class QueueJob extends OnlyOnceJob {
timer.stop();
}
- logger.info( "execute QueueJob completed normally" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("execute QueueJob completed normally");
+ }
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
index 6d6123c..0a0e982 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
@@ -92,7 +92,9 @@ public class QueueListener {
// boolean shouldRun = new Boolean(properties.getProperty("usergrid.notifications.listener.run", "false"));
- logger.info("QueueListener: starting.");
+ if (logger.isDebugEnabled()) {
+ logger.debug("QueueListener: starting.");
+ }
int threadCount = 0;
try {
@@ -112,7 +114,9 @@ public class QueueListener {
pool = Executors.newFixedThreadPool(maxThreads);
while (threadCount++ < maxThreads) {
- logger.info("QueueListener: Starting thread {}.", threadCount);
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueListener: Starting thread {}.", threadCount);
+ }
final int threadNumber = threadCount;
Runnable task = new Runnable() {
@Override
@@ -134,7 +138,9 @@ public class QueueListener {
} catch (Exception e) {
logger.error("QueueListener: failed to start:", e);
}
- logger.info("QueueListener: done starting.");
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueListener: done starting.");
+ }
}
private void execute(int threadNumber){
@@ -144,11 +150,15 @@ public class QueueListener {
Thread.currentThread().setName(getClass().getSimpleName()+"_PushNotifications-"+threadNumber);
final AtomicInteger consecutiveExceptions = new AtomicInteger();
- logger.info("QueueListener: Starting execute process.");
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueListener: Starting execute process.");
+ }
Meter meter = metricsService.getMeter(QueueListener.class, "execute.commit");
com.codahale.metrics.Timer timer = metricsService.getTimer(QueueListener.class, "execute.dequeue");
svcMgr = smf.getServiceManager(smf.getManagementAppId());
- logger.info("getting from queue {} ", queueName);
+ if (logger.isTraceEnabled()) {
+ logger.trace("getting from queue {} ", queueName);
+ }
QueueScope queueScope = new QueueScopeImpl( queueName, QueueScope.RegionImplementation.LOCAL);
QueueManager queueManager = queueManagerFactory.getQueueManager(queueScope);
// run until there are no more active jobs
@@ -164,7 +174,9 @@ public class QueueListener {
.doOnNext(messages -> {
try {
- logger.info("retrieved batch of {} messages from queue {} ", messages.size(),queueName);
+ if (logger.isTraceEnabled()) {
+ logger.trace("retrieved batch of {} messages from queue {}", messages.size(), queueName);
+ }
if (messages.size() > 0) {
HashMap<UUID, List<QueueMessage>> messageMap = new HashMap<>(messages.size());
@@ -193,7 +205,9 @@ public class QueueListener {
for (Map.Entry<UUID, List<QueueMessage>> entry : messageMap.entrySet()) {
UUID applicationId = entry.getKey();
ApplicationQueueManager manager = queueManagerMap.get(applicationId);
- logger.info("send batch for app {} of {} messages", entry.getKey(), entry.getValue().size());
+ if (logger.isTraceEnabled()) {
+ logger.trace("send batch for app {} of {} messages", entry.getKey(), entry.getValue().size());
+ }
Observable current = manager.sendBatchToProviders(entry.getValue(),queueName);
if(merge == null)
@@ -209,10 +223,14 @@ public class QueueListener {
queueManager.commitMessages(messages);
meter.mark(messages.size());
- logger.info("sent batch {} messages duration {} ms", messages.size(),System.currentTimeMillis() - now);
+ if (logger.isTraceEnabled()) {
+ logger.trace("sent batch {} messages duration {} ms", messages.size(), System.currentTimeMillis() - now);
+ }
if(sleepBetweenRuns > 0) {
- logger.info("sleep between rounds...sleep...{}", sleepBetweenRuns);
+ if (logger.isTraceEnabled()) {
+ logger.trace("sleep between rounds...sleep...{}", sleepBetweenRuns);
+ }
Thread.sleep(sleepBetweenRuns);
}
@@ -230,7 +248,9 @@ public class QueueListener {
}
else{
- logger.info("no messages...sleep...{}", sleepWhenNoneFound);
+ if (logger.isTraceEnabled()) {
+ logger.trace("no messages...sleep...{}", sleepWhenNoneFound);
+ }
Thread.sleep(sleepWhenNoneFound);
}
timerContext.stop();
@@ -245,7 +265,9 @@ public class QueueListener {
logger.info("sleeping due to failures {} ms", sleeptime);
Thread.sleep(sleeptime);
}catch (InterruptedException ie){
- logger.info("sleep interrupted");
+ if (logger.isTraceEnabled()) {
+ logger.info("sleep interrupted");
+ }
}
}
})
@@ -293,7 +315,9 @@ public class QueueListener {
}
public void stop(){
- logger.info("stop processes");
+ if (logger.isDebugEnabled()) {
+ logger.debug("stop processes");
+ }
if(futures == null){
return;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
index 6c7e53c..4f051e6 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
@@ -53,41 +53,41 @@ public class TaskManager {
completed(notifier,null,deviceUUID,null);
}
public void completed(Notifier notifier, Receipt receipt, UUID deviceUUID, String newProviderId) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("REMOVED {}", deviceUUID);
+ if (logger.isTraceEnabled()) {
+ logger.trace("REMOVED {}", deviceUUID);
}
try {
- if (logger.isDebugEnabled()) {
- logger.debug("notification {} removing device {} from remaining", notification.getUuid(), deviceUUID);
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} removing device {} from remaining", notification.getUuid(), deviceUUID);
}
EntityRef deviceRef = new SimpleEntityRef(Device.ENTITY_TYPE, deviceUUID);
if (receipt != null) {
- if (logger.isDebugEnabled()) {
- logger.debug("notification {} sent to device {}. saving receipt.", notification.getUuid(), deviceUUID);
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} sent to device {}. saving receipt.", notification.getUuid(), deviceUUID);
}
receipt.setSent(System.currentTimeMillis());
this.saveReceipt(notification, deviceRef, receipt,false);
- if (logger.isDebugEnabled()) {
- logger.debug("notification {} receipt saved for device {}", notification.getUuid(), deviceUUID);
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} receipt saved for device {}", notification.getUuid(), deviceUUID);
}
successes.incrementAndGet();
}
if (newProviderId != null) {
- if (logger.isDebugEnabled()) {
- logger.debug("notification {} replacing device {} notifierId", notification.getUuid(), deviceUUID);
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} replacing device {} notifierId", notification.getUuid(), deviceUUID);
}
replaceProviderId(deviceRef, notifier, newProviderId);
}
- if (logger.isDebugEnabled()) {
- logger.debug("notification {} completed device {}", notification.getUuid(), deviceUUID);
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} completed device {}", notification.getUuid(), deviceUUID);
}
} finally {
- if (logger.isDebugEnabled()) {
- logger.debug("COUNT is: {}", successes.get());
+ if (logger.isTraceEnabled()) {
+ logger.trace("COUNT is: {}", successes.get());
}
if (hasFinished) { //process has finished but notifications are still coming in
finishedBatch();
@@ -100,11 +100,7 @@ public class TaskManager {
try {
if (logger.isDebugEnabled()) {
- StringBuilder sb = new StringBuilder();
- sb.append("notification ").append(notification.getUuid());
- sb.append(" for device ").append(deviceUUID);
- sb.append(" got error ").append(code);
- logger.debug(sb.toString());
+ logger.debug("notification {} for device {} got error {}", notification.getUuid(), deviceUUID, code);
}
failures.incrementAndGet();
@@ -194,7 +190,7 @@ public class TaskManager {
notification.addProperties(properties);
long latency = notification.getFinished() - notification.getStarted();
- logger.info("notification finished batch: {} of {} devices in " + latency + "ms", notification.getUuid(), totals);
+ logger.info("notification finished batch: {} of {} devices in {} ms", notification.getUuid(), totals, latency);
em.update(notification);
// Set<Notifier> notifiers = new HashSet<>(proxy.getAdapterMap().values()); // remove dups
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
index 3549777..3d4911d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
@@ -139,9 +139,7 @@ public class APNsAdapter implements ProviderAdapter {
pushManager.start();
}
} catch (IllegalStateException ise) {
- if (logger.isDebugEnabled()) {
- logger.debug("failed to start", ise);//could have failed because its started
- }
+ logger.warn("getPushManager: failed to start", ise);//could have failed because its started
}
}
return pushManager;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/RejectedAPNsListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/RejectedAPNsListener.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/RejectedAPNsListener.java
index 545dc0c..dc842e7 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/RejectedAPNsListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/RejectedAPNsListener.java
@@ -28,6 +28,8 @@ import org.slf4j.LoggerFactory;
*/
public class RejectedAPNsListener implements RejectedNotificationListener<SimpleApnsPushNotification>{
+ private static final Logger logger = LoggerFactory.getLogger(RejectedAPNsListener.class);
+
@Override
public void handleRejectedNotification(PushManager<? extends SimpleApnsPushNotification> pushManager, SimpleApnsPushNotification notification, RejectedNotificationReason rejectionReason) {
try {
@@ -48,6 +50,4 @@ public class RejectedAPNsListener implements RejectedNotificationListener<Simple
}
System.out.format("%s was rejected with rejection reason %s\n", notification, rejectionReason);
}
-
- private static final Logger logger = LoggerFactory.getLogger(RejectedAPNsListener.class);
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/gcm/GCMAdapter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/gcm/GCMAdapter.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/gcm/GCMAdapter.java
index 18c193f..f267fab 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/gcm/GCMAdapter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/gcm/GCMAdapter.java
@@ -39,7 +39,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class GCMAdapter implements ProviderAdapter {
- private static final Logger LOG = LoggerFactory.getLogger(GCMAdapter.class);
+ private static final Logger logger = LoggerFactory.getLogger(GCMAdapter.class);
private static final int SEND_RETRIES = 3;
private static int BATCH_SIZE = 1000;
private final Notifier notifier;
@@ -65,10 +65,14 @@ public class GCMAdapter implements ProviderAdapter {
ids.add("device_token");
try {
MulticastResult result = sender.send(message, ids, 1);
- LOG.debug("testConnection result: {}", result);
+ if (logger.isTraceEnabled()) {
+ logger.trace("testConnection result: {}", result);
+ }
} catch (InvalidRequestException e){
// do nothing, we don't have a valid device token to test with
- LOG.debug("here for testing only");
+ if (logger.isTraceEnabled()) {
+ logger.trace("no valid device token");
+ }
}
catch (IOException e) {
if(isInvalidRequestException(e)){
@@ -164,7 +168,7 @@ public class GCMAdapter implements ProviderAdapter {
}
}
}catch (Exception e){
- LOG.error("error while trying to send on stop",e);
+ logger.error("error while trying to send on stop",e);
}
}
@@ -265,7 +269,9 @@ public class GCMAdapter implements ProviderAdapter {
}
- LOG.debug("sendNotification result: {}", multicastResult);
+ if (logger.isTraceEnabled()) {
+ logger.trace("sendNotification result: {}", multicastResult);
+ }
for (int i = 0; i < multicastResult.getResults().size(); i++) {
Result result = multicastResult.getResults().get(i);
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 22b7d51..42ef433 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -83,14 +83,18 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
long startTime = System.currentTimeMillis();
if (notification.getCanceled() == Boolean.TRUE) {
- logger.info("notification " + notification.getUuid() + " canceled");
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification " + notification.getUuid() + " canceled");
+ }
if (jobExecution != null) {
jobExecution.killed();
}
return;
}
- logger.info("notification {} start queuing", notification.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} start queuing", notification.getUuid());
+ }
final PathQuery<Device> pathQuery = notification.getPathQuery().buildPathQuery() ; //devices query
final AtomicInteger deviceCount = new AtomicInteger(); //count devices so you can make a judgement on batching
@@ -100,7 +104,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
//get devices in querystring, and make sure you have access
if (pathQuery != null) {
final HashMap<Object,ProviderAdapter> notifierMap = getAdapterMap();
- logger.info("notification {} start query", notification.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} start query", notification.getUuid());
+ }
final Iterator<Device> iterator = pathQuery.iterator(em);
//if there are more pages (defined by PAGE_SIZE) you probably want this to be async, also if this is already a job then don't reschedule
if (iterator instanceof ResultsIterator && ((ResultsIterator) iterator).hasPages() && jobExecution == null) {
@@ -119,13 +125,19 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
long now = System.currentTimeMillis();
List<EntityRef> devicesRef = getDevices(entity); // resolve group
- logger.info("notification {} queue {} devices, duration "+(System.currentTimeMillis()-now)+" ms", notification.getUuid(), devicesRef.size());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} queue {} devices, duration {} ms", notification.getUuid(), devicesRef.size(), (System.currentTimeMillis() - now));
+ }
for (EntityRef deviceRef : devicesRef) {
- logger.info("notification {} starting to queue device {} ", notification.getUuid(), deviceRef.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} starting to queue device {} ", notification.getUuid(), deviceRef.getUuid());
+ }
long hash = MurmurHash.hash(deviceRef.getUuid());
if (sketch.estimateCount(hash) > 0) { //look for duplicates
- logger.warn("Maybe Found duplicate device: {}", deviceRef.getUuid());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Maybe Found duplicate device: {}", deviceRef.getUuid());
+ }
continue;
} else {
sketch.add(hash, 1);
@@ -143,7 +155,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
notifierKey = entry.getKey().toLowerCase();
break;
}
- logger.info("Provider query for notification {} device {} took "+(System.currentTimeMillis()-now)+" ms",notification.getUuid(),deviceRef.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("Provider query for notification {} device {} took {} ms", notification.getUuid(), deviceRef.getUuid(), (System.currentTimeMillis() - now));
+ }
}
if (notifierId == null) {
@@ -156,11 +170,15 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
// update queued time
now = System.currentTimeMillis();
notification.setQueued(System.currentTimeMillis());
- logger.info("notification {} device {} queue time set. duration "+(System.currentTimeMillis()-now)+" ms", notification.getUuid(), deviceRef.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} device {} queue time set. duration {} ms", notification.getUuid(), deviceRef.getUuid(), (System.currentTimeMillis() - now));
+ }
}
now = System.currentTimeMillis();
qm.sendMessage(message);
- logger.info("notification {} post-queue to device {} duration " + (System.currentTimeMillis() - now) + " ms "+queueName+" queue", notification.getUuid(), deviceRef.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} post-queue to device {} duration {} ms, {} queue", notification.getUuid(), deviceRef.getUuid(), (System.currentTimeMillis() - now), queueName);
+ }
deviceCount.incrementAndGet();
queueMeter.mark();
}
@@ -185,11 +203,13 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
, 10);
o.toBlocking().lastOrDefault( null );
- logger.info( "notification {} done queueing duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} done queueing duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
+ }
}
// update queued time
- Map<String, Object> properties = new HashMap<String, Object>(2);
+ Map<String, Object> properties = new HashMap<>(2);
properties.put("queued", notification.getQueued());
properties.put("state", notification.getState());
if(errorMessages.size()>0){
@@ -215,7 +235,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
}
long elapsed = notification.getQueued() != null ? notification.getQueued() - startTime : 0;
- logger.info("notification {} done queuing to {} devices in " + elapsed + " ms", notification.getUuid().toString(), deviceCount.get());
+ if (logger.isTraceEnabled()) {
+ logger.trace("notification {} done queuing to {} devices in {} ms", notification.getUuid().toString(), deviceCount.get(), elapsed);
+ }
}
/**
@@ -260,7 +282,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
*/
@Override
public Observable sendBatchToProviders(final List<QueueMessage> messages, final String queuePath) {
- logger.info("sending batch of {} notifications.", messages.size());
+ if (logger.isTraceEnabled()) {
+ logger.trace("sending batch of {} notifications.", messages.size());
+ }
final Map<Object, ProviderAdapter> notifierMap = getAdapterMap();
final ApplicationQueueManagerImpl proxy = this;
@@ -274,7 +298,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
ApplicationQueueMessage message = null;
try {
message = (ApplicationQueueMessage) queueMessage.getBody();
- logger.info("start sending notification for device {} for Notification: {} on thread "+Thread.currentThread().getId(), message.getDeviceId(), message.getNotificationId());
+ if (logger.isTraceEnabled()) {
+ logger.trace("start sending notification for device {} for Notification: {} on thread {}", message.getDeviceId(), message.getNotificationId(), Thread.currentThread().getId());
+ }
UUID deviceUUID = message.getDeviceId();
@@ -292,7 +318,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
final Map<String, Object> payloads = notification.getPayloads();
final Map<String, Object> translatedPayloads = translatePayloads(payloads, notifierMap);
- logger.info("sending notification for device {} for Notification: {}", deviceUUID, notification.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("sending notification for device {} for Notification: {}", deviceUUID, notification.getUuid());
+ }
try {
String notifierName = message.getNotifierKey().toLowerCase();
@@ -315,7 +343,9 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
} catch (Exception e) {
tracker.failed(0, e.getMessage());
} finally {
- logger.info("sending to device {} for Notification: {} duration " + (System.currentTimeMillis() - now) + " ms", deviceUUID, notification.getUuid());
+ if (logger.isTraceEnabled()) {
+ logger.trace("sending to device {} for Notification: {} duration {} ms", deviceUUID, notification.getUuid(), (System.currentTimeMillis() - now));
+ }
}
}
}
@@ -448,13 +478,13 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
for (final ProviderAdapter providerAdapter : providerAdapters) {
try {
if (providerAdapter != null) {
- if (logger.isDebugEnabled()) {
- logger.debug("checking notifier {} for inactive devices", providerAdapter.getNotifier());
+ if (logger.isTraceEnabled()) {
+ logger.trace("checking notifier {} for inactive devices", providerAdapter.getNotifier());
}
providerAdapter.removeInactiveDevices();
- if (logger.isDebugEnabled()) {
- logger.debug("finished checking notifier {} for inactive devices", providerAdapter.getNotifier());
+ if (logger.isTraceEnabled()) {
+ logger.trace("finished checking notifier {} for inactive devices", providerAdapter.getNotifier());
}
}
} catch (Exception e) {
@@ -470,18 +500,24 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
private boolean isOkToSend(Notification notification) {
Map<String,Long> stats = notification.getStatistics();
if (stats != null && notification.getExpectedCount() == (stats.get("sent")+ stats.get("errors"))) {
- logger.info("notification {} already processed. not sending.",
- notification.getUuid());
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} already processed. not sending.",
+ notification.getUuid());
+ }
return false;
}
if (notification.getCanceled() == Boolean.TRUE) {
- logger.info("notification {} canceled. not sending.",
- notification.getUuid());
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} canceled. not sending.",
+ notification.getUuid());
+ }
return false;
}
if (notification.isExpired()) {
- logger.info("notification {} expired. not sending.",
- notification.getUuid());
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} expired. not sending.",
+ notification.getUuid());
+ }
return false;
}
return true;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java b/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
index 3e9ca3e..54a9dc4 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifiers/NotifiersService.java
@@ -32,7 +32,9 @@ public class NotifiersService extends AbstractCollectionService {
public NotifiersService() {
super();
- logger.info("/notifiers");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/notifiers");
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java b/stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java
index 975b368..a95475d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java
@@ -73,8 +73,8 @@ public class ImportQueueListener extends QueueListener {
* of the message and typecast it into a model called ApplicationQueueMessage. Then it does
* work on the message.
*/
- if (logger.isDebugEnabled()) {
- logger.debug("Doing work in onMessage in ImportQueueListener");
+ if (logger.isTraceEnabled()) {
+ logger.trace("Doing work in onMessage in ImportQueueListener");
}
for (QueueMessage message : messages) {
ImportQueueMessage queueMessage = ( ImportQueueMessage ) message.getBody();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/queues/QueueListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/queues/QueueListener.java b/stack/services/src/main/java/org/apache/usergrid/services/queues/QueueListener.java
index bafa3a2..7ceb2ae 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/queues/QueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/queues/QueueListener.java
@@ -102,7 +102,9 @@ public abstract class QueueListener {
boolean shouldRun = new Boolean(properties.getProperty("usergrid.queues.listener.run", "true"));
if(shouldRun) {
- logger.info("QueueListener: starting.");
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueListener: starting.");
+ }
int threadCount = 0;
try {
@@ -121,14 +123,16 @@ public abstract class QueueListener {
pool = Executors.newFixedThreadPool(maxThreads);
while (threadCount++ < maxThreads) {
- logger.info("QueueListener: Starting thread {}.", threadCount);
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueListener: Starting thread {}.", threadCount);
+ }
Runnable task = new Runnable() {
@Override
public void run() {
try {
execute();
} catch (Exception e) {
- logger.error("failed to start push", e);
+ logger.warn("failed to start push", e);
}
}
};
@@ -137,7 +141,9 @@ public abstract class QueueListener {
} catch (Exception e) {
logger.error("QueueListener: failed to start:", e);
}
- logger.info("QueueListener: done starting.");
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueListener: done starting.");
+ }
}else{
logger.info("QueueListener: never started due to config value usergrid.queues.listener.run.");
}
@@ -156,9 +162,13 @@ public abstract class QueueListener {
Thread.currentThread().setName("queues_Processor"+UUID.randomUUID());
final AtomicInteger consecutiveExceptions = new AtomicInteger();
- logger.info("QueueListener: Starting execute process.");
+ if (logger.isTraceEnabled()) {
+ logger.trace("QueueListener: Starting execute process.");
+ }
svcMgr = smf.getServiceManager(smf.getManagementAppId());
- logger.info("getting from queue {} ", queueName);
+ if (logger.isTraceEnabled()) {
+ logger.trace("getting from queue {} ", queueName);
+ }
QueueScope queueScope = new QueueScopeImpl( queueName, QueueScope.RegionImplementation.LOCAL);
QueueManager queueManager = queueManagerFactory.getQueueManager(queueScope);
// run until there are no more active jobs
@@ -175,7 +185,9 @@ public abstract class QueueListener {
.buffer(getBatchSize())
.doOnNext(messages -> {
try {
- logger.info("retrieved batch of {} messages from queue {} ", messages.size(), queueName);
+ if (logger.isTraceEnabled()) {
+ logger.trace("retrieved batch of {} messages from queue {} ", messages.size(), queueName);
+ }
if (messages.size() > 0) {
@@ -188,15 +200,21 @@ public abstract class QueueListener {
queueManager.commitMessages(messages);
meter.mark(messages.size());
- logger.info("sent batch {} messages duration {} ms", messages.size(), System.currentTimeMillis() - now);
+ if (logger.isTraceEnabled()) {
+ logger.trace("sent batch {} messages duration {} ms", messages.size(), System.currentTimeMillis() - now);
+ }
if (sleepBetweenRuns > 0) {
- logger.info("sleep between rounds...sleep...{}", sleepBetweenRuns);
+ if (logger.isTraceEnabled()) {
+ logger.trace("sleep between rounds...sleep...{}", sleepBetweenRuns);
+ }
Thread.sleep(sleepBetweenRuns);
}
} else {
- logger.info("no messages...sleep...{}", sleepWhenNoneFound);
+ if (logger.isTraceEnabled()) {
+ logger.trace("no messages...sleep...{}", sleepWhenNoneFound);
+ }
Thread.sleep(sleepWhenNoneFound);
}
timerContext.stop();
@@ -208,10 +226,14 @@ public abstract class QueueListener {
long sleeptime = sleepWhenNoneFound * consecutiveExceptions.incrementAndGet();
long maxSleep = 15000;
sleeptime = sleeptime > maxSleep ? maxSleep : sleeptime;
- logger.info("sleeping due to failures {} ms", sleeptime);
+ if (logger.isTraceEnabled()) {
+ logger.trace("sleeping due to failures {} ms", sleeptime);
+ }
Thread.sleep(sleeptime);
} catch (InterruptedException ie) {
- logger.info("sleep interrupted");
+ if (logger.isTraceEnabled()) {
+ logger.trace("sleep interrupted");
+ }
}
}
}).toBlocking().lastOrDefault(null);
@@ -220,7 +242,9 @@ public abstract class QueueListener {
public void stop(){
- logger.info("stop processes");
+ if (logger.isTraceEnabled()) {
+ logger.trace("stop processes");
+ }
if(futures == null){
return;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java b/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java
index ff36450..09209cc 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/roles/RolesService.java
@@ -44,8 +44,8 @@ public class RolesService extends AbstractCollectionService {
public RolesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/roles");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/roles");
}
declareEntityDictionary( "permissions" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/roles/groups/GroupsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/roles/groups/GroupsService.java b/stack/services/src/main/java/org/apache/usergrid/services/roles/groups/GroupsService.java
index 9bf89ee..be1f1c0 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/roles/groups/GroupsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/roles/groups/GroupsService.java
@@ -28,8 +28,8 @@ public class GroupsService extends org.apache.usergrid.services.groups.GroupsSer
public GroupsService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/roles/*/groups");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/roles/*/groups");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/roles/users/UsersService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/roles/users/UsersService.java b/stack/services/src/main/java/org/apache/usergrid/services/roles/users/UsersService.java
index 8ee733d..378a58e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/roles/users/UsersService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/roles/users/UsersService.java
@@ -36,8 +36,8 @@ public class UsersService extends org.apache.usergrid.services.users.UsersServic
public UsersService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/roles/*/users");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/roles/*/users");
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java
index 4a5ca68..3092a0e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/UsersService.java
@@ -55,13 +55,13 @@ import static org.apache.usergrid.utils.ConversionUtils.string;
public class UsersService extends AbstractCollectionService {
- private static final Logger LOG = LoggerFactory.getLogger( UsersService.class );
+ private static final Logger logger = LoggerFactory.getLogger( UsersService.class );
public UsersService() {
super();
- if (LOG.isDebugEnabled()) {
- LOG.debug("/users");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/users");
}
makeConnectionPrivate( "following" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java
index 0961708..b97c1ee 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/activities/ActivitiesService.java
@@ -39,8 +39,8 @@ public class ActivitiesService extends GenericCollectionService {
public ActivitiesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/users/*/activities");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/users/*/activities");
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java
index 8e7ba3b..84009fd 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/devices/DevicesService.java
@@ -34,28 +34,28 @@ public class DevicesService extends org.apache.usergrid.services.devices.Devices
public DevicesService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/users/*/devices");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/users/*/devices");
}
}
@Override
public ServiceResults putItemById( ServiceContext context, UUID id ) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("Registering device {}", id);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Registering device {}", id);
}
unregisterDeviceToUsers(id,context.getOwner());
- ServiceResults results = super.putItemById( context, id );
- return results;
+ return super.putItemById( context, id );
}
@Override
public ServiceResults postItemById( ServiceContext context, UUID id ) throws Exception {
- logger.info( "Attempting to connect an entity to device {}", id );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Attempting to connect an entity to device {}", id);
+ }
unregisterDeviceToUsers(id,context.getOwner());
- ServiceResults results = super.postItemById( context, id );
- return results;
+ return super.postItemById( context, id );
}
protected void unregisterDeviceToUsers(UUID deviceId, EntityRef owner){
@@ -63,7 +63,7 @@ public class DevicesService extends org.apache.usergrid.services.devices.Devices
EntityRef device = new SimpleEntityRef("device",deviceId);
deleteEntityConnection(device,owner);
} catch (Exception e) {
- logger.error("Failed to delete connection for " + deviceId.toString(), e);
+ logger.error("Failed to delete connection for {}", deviceId.toString(), e);
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/users/devices/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/devices/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/devices/notifications/NotificationsService.java
index 79972c6..b85b86f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/devices/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/devices/notifications/NotificationsService.java
@@ -26,7 +26,9 @@ public class NotificationsService extends
.getLogger(NotificationsService.class);
public NotificationsService() {
- logger.info("/users/*/devices/*/notifications");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/users/*/devices/*/notifications");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/users/following/FollowingService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/following/FollowingService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/following/FollowingService.java
index 7c900bc..b14f129 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/following/FollowingService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/following/FollowingService.java
@@ -46,7 +46,9 @@ public class FollowingService extends AbstractConnectionsService {
public void copyActivityFeed( final EntityRef connectingEntity, final EntityRef connectedEntityRef )
throws Exception {
- logger.info( "Copying activities to feed..." );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Copying activities to feed...");
+ }
TaskExecutor taskExecutor = ( TaskExecutor ) getApplicationContext().getBean( "taskExecutor" );
taskExecutor.execute( new Runnable() {
@Override
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/users/groups/GroupsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/groups/GroupsService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/groups/GroupsService.java
index d825d6a..4fceacc 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/groups/GroupsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/groups/GroupsService.java
@@ -28,8 +28,8 @@ public class GroupsService extends org.apache.usergrid.services.groups.GroupsSer
public GroupsService() {
super();
- if (logger.isDebugEnabled()) {
- logger.debug("/users/*/groups");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/users/*/groups");
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/users/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/notifications/NotificationsService.java
index 4b536bc..f4ce7e2 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/notifications/NotificationsService.java
@@ -26,7 +26,9 @@ public class NotificationsService extends
.getLogger(NotificationsService.class);
public NotificationsService() {
- logger.info("/users/*/notifications");
+ if (logger.isTraceEnabled()) {
+ logger.trace("/users/*/notifications");
+ }
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/users/roles/RolesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/users/roles/RolesService.java b/stack/services/src/main/java/org/apache/usergrid/services/users/roles/RolesService.java
index 6da58bf..1f7637f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/users/roles/RolesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/users/roles/RolesService.java
@@ -38,7 +38,9 @@ public class RolesService extends org.apache.usergrid.services.roles.RolesServic
public RolesService() {
super();
- logger.info( "/users/*/roles" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("/users/*/roles");
+ }
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/utils/PythonUtils.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/utils/PythonUtils.java b/stack/services/src/main/java/org/apache/usergrid/utils/PythonUtils.java
index 99d0da5..773b05c 100644
--- a/stack/services/src/main/java/org/apache/usergrid/utils/PythonUtils.java
+++ b/stack/services/src/main/java/org/apache/usergrid/utils/PythonUtils.java
@@ -39,7 +39,7 @@ public class PythonUtils {
pyObject = interpreter.get( clsName );
}
catch ( Exception e ) {
- logger.error( "The Python module '" + moduleName + "' is not found: " + compactWhitespace( e.toString() ) );
+ logger.error( "The Python module '{}' is not found: {}", moduleName, compactWhitespace( e.toString() ) );
}
return pyObject;
}
@@ -71,7 +71,7 @@ public class PythonUtils {
interfaceType.toString().indexOf( " " ) + 1, interfaceType.toString().length() ) ) );
}
catch ( Exception ex ) {
- logger.error( "Unable to create Python object: " + compactWhitespace( ex.toString() ) );
+ logger.error( "Unable to create Python object: {}", compactWhitespace( ex.toString() ) );
}
return javaObj;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
index a87af41..34ddc55 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/CassandraResource.java
@@ -108,7 +108,7 @@ public class CassandraResource extends EnvironResource {
System.setProperty( "cassandra." + RPC_PORT_KEY, Integer.toString( port ) );
- logger.info( "project.properties loaded properties for ports : " + "[rpc] = [{}]", new Object[] { port } );
+ logger.info( "project.properties loaded properties for ports : [rpc] = [{}]", port );
initialized = true;
[4/7] usergrid git commit: USERGRID-1243: logging overhaul, pt. 1
Posted by mr...@apache.org.
USERGRID-1243: logging overhaul, pt. 1
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/71fb6100
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/71fb6100
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/71fb6100
Branch: refs/heads/master
Commit: 71fb6100c614e320441e3df07f5c7de680f90403
Parents: 0d4c35f
Author: Mike Dunker <md...@apigee.com>
Authored: Fri Jan 29 18:36:39 2016 -0800
Committer: Mike Dunker <md...@apigee.com>
Committed: Fri Jan 29 18:36:39 2016 -0800
----------------------------------------------------------------------
.../batch/service/SchedulerServiceImpl.java | 4 +-
.../hazelcast/HazelcastLifecycleMonitor.java | 8 +-
.../corepersistence/CpEntityManager.java | 89 +++++++++-----------
.../corepersistence/CpEntityManagerFactory.java | 8 +-
.../corepersistence/CpRelationManager.java | 71 +++++++---------
.../usergrid/corepersistence/CpSetup.java | 2 +-
.../usergrid/corepersistence/CpWalker.java | 3 +-
.../usergrid/corepersistence/GuiceFactory.java | 4 +-
.../asyncevents/AmazonAsyncEventService.java | 7 +-
.../asyncevents/EventBuilderImpl.java | 31 +++----
.../index/ReIndexServiceImpl.java | 6 +-
.../search/AbstractElasticSearchFilter.java | 4 +-
.../read/search/CandidateEntityFilter.java | 9 +-
.../pipeline/read/search/CandidateIdFilter.java | 6 +-
.../read/search/SearchConnectionFilter.java | 8 +-
.../usergrid/count/CassandraCounterStore.java | 6 +-
.../usergrid/count/CassandraSubmitter.java | 4 +-
.../org/apache/usergrid/mq/CounterQuery.java | 4 -
.../main/java/org/apache/usergrid/mq/Query.java | 16 ++--
.../usergrid/mq/cassandra/CassandraMQUtils.java | 8 +-
.../usergrid/mq/cassandra/QueueManagerImpl.java | 18 ++--
.../mq/cassandra/io/AbstractSearch.java | 5 +-
.../mq/cassandra/io/ConsumerTransaction.java | 24 +++---
.../mq/cassandra/io/NoTransactionSearch.java | 2 +-
.../org/apache/usergrid/persistence/Schema.java | 12 +--
.../cassandra/CassandraPersistenceUtils.java | 6 +-
.../persistence/cassandra/CassandraService.java | 64 +++++++-------
.../cassandra/ConnectionRefImpl.java | 4 +-
.../persistence/cassandra/CounterUtils.java | 26 +++---
.../usergrid/persistence/cassandra/Setup.java | 4 -
.../cassandra/util/Slf4jTraceTagReporter.java | 4 +-
.../cassandra/util/TraceTagAspect.java | 8 +-
.../cassandra/util/TraceTagManager.java | 8 +-
.../usergrid/system/UsergridSystemMonitor.java | 2 +-
.../org/apache/usergrid/utils/AESUtils.java | 8 +-
.../apache/usergrid/utils/ConversionUtils.java | 6 +-
.../org/apache/usergrid/utils/IndexUtils.java | 4 +-
.../org/apache/usergrid/utils/JsonUtils.java | 22 ++---
.../org/apache/usergrid/utils/ListUtils.java | 10 +--
.../org/apache/usergrid/utils/StringUtils.java | 4 +-
.../impl/ScopedCacheSerializationImpl.java | 6 +-
.../mvcc/stage/delete/MarkCommit.java | 6 +-
.../collection/mvcc/stage/delete/MarkStart.java | 4 +-
.../mvcc/stage/delete/VersionCompact.java | 2 +-
.../mvcc/stage/write/RollbackAction.java | 2 +-
.../mvcc/stage/write/WriteCommit.java | 6 +-
.../mvcc/stage/write/WriteOptimisticVerify.java | 4 +-
.../collection/mvcc/stage/write/WriteStart.java | 6 +-
.../mvcc/stage/write/WriteUniqueVerify.java | 2 +-
.../MvccEntitySerializationStrategyImpl.java | 8 +-
.../MvccLogEntrySerializationStrategyImpl.java | 6 +-
.../UniqueValueSerializationStrategyImpl.java | 7 +-
.../migration/MvccEntityDataMigrationImpl.java | 6 +-
.../astyanax/MultiKeyColumnNameIterator.java | 4 +-
.../core/executor/TaskExecutorFactory.java | 6 +-
.../core/metrics/MetricsFactoryImpl.java | 6 +-
.../migration/schema/MigrationManagerImpl.java | 5 +-
.../persistence/core/rx/ObservableIterator.java | 4 +-
.../persistence/core/rx/OrderedMerge.java | 6 +-
.../graph/impl/GraphManagerImpl.java | 14 +--
.../graph/impl/stage/EdgeMetaRepairImpl.java | 46 ++++++----
.../impl/stage/NodeDeleteListenerImpl.java | 20 +++--
.../serialization/impl/EdgesObservableImpl.java | 16 +++-
.../impl/TargetIdObservableImpl.java | 4 +-
.../impl/migration/EdgeDataMigrationImpl.java | 2 +-
.../impl/shard/ShardEntryGroup.java | 18 ++--
.../shard/impl/NodeShardAllocationImpl.java | 2 +-
.../impl/shard/impl/NodeShardCacheImpl.java | 2 +-
.../shard/impl/ShardGroupCompactionImpl.java | 22 +++--
.../impl/shard/impl/ShardGroupDeletionImpl.java | 2 +-
.../index/impl/EntityMappingParser.java | 5 +-
.../index/impl/EsEntityIndexBatchImpl.java | 22 +++--
.../index/impl/EsEntityIndexImpl.java | 49 +++++++----
.../index/impl/EsIndexProducerImpl.java | 18 ++--
.../persistence/index/impl/EsProvider.java | 8 +-
.../index/impl/FailureMonitorImpl.java | 7 +-
.../EsIndexMappingMigrationPlugin.java | 2 +-
.../index/query/ParsedQueryBuilder.java | 4 +-
.../index/utils/ConversionUtils.java | 6 +-
.../persistence/index/utils/ListUtils.java | 10 +--
.../persistence/index/impl/GeoPagingTest.java | 1 -
.../persistence/queue/impl/QueueScopeImpl.java | 3 -
.../queue/impl/SNSQueueManagerImpl.java | 77 +++++++++--------
.../queue/util/AmazonNotificationUtils.java | 22 +++--
stack/pom.xml | 2 +-
.../usergrid/rest/AbstractContextResource.java | 10 +--
.../org/apache/usergrid/rest/RootResource.java | 8 +-
.../apache/usergrid/rest/SwaggerServlet.java | 16 +++-
.../rest/applications/ApplicationResource.java | 38 ++++-----
.../rest/applications/AuthResource.java | 20 +++--
.../rest/applications/ServiceResource.java | 60 ++++++-------
.../applications/assets/AssetsResource.java | 34 ++++++--
.../notifiers/NotifierResource.java | 4 +-
.../notifiers/NotifiersResource.java | 14 +--
.../rest/applications/queues/QueueResource.java | 40 ++++++---
.../queues/QueueSubscriberResource.java | 20 +++--
.../queues/QueueSubscriptionResource.java | 20 +++--
.../rest/applications/users/UserResource.java | 52 +++++++++---
.../rest/applications/users/UsersResource.java | 18 ++--
.../exceptions/AbstractExceptionMapper.java | 8 +-
.../exceptions/NotAllowedExceptionMapper.java | 3 -
.../rest/filters/ContentTypeFilter.java | 18 ++--
.../rest/filters/JSONPCallbackFilter.java | 4 +-
.../rest/management/ManagementResource.java | 22 +++--
.../organizations/OrganizationResource.java | 30 ++++---
.../organizations/OrganizationsResource.java | 8 +-
.../applications/ApplicationResource.java | 8 +-
.../applications/ApplicationsResource.java | 4 +-
.../applications/imports/ImportsResource.java | 6 +-
.../organizations/users/UsersResource.java | 2 +-
.../rest/management/users/UserResource.java | 4 +-
.../rest/management/users/UsersResource.java | 4 +-
.../organizations/OrganizationResource.java | 4 +-
.../security/SecuredResourceFilterFactory.java | 56 ++++++------
.../security/shiro/RestSecurityManager.java | 2 +-
.../shiro/filters/BasicAuthSecurityFilter.java | 8 +-
.../ClientCredentialsSecurityFilter.java | 4 +-
.../OAuth2AccessTokenSecurityFilter.java | 4 +-
.../rest/system/ApplicationsResource.java | 6 +-
.../usergrid/rest/system/DatabaseResource.java | 4 +-
.../usergrid/rest/system/IndexResource.java | 4 +-
.../usergrid/rest/system/MigrateResource.java | 4 +-
.../applications/queries/GeoPagingTest.java | 1 -
.../rest/applications/queries/OrderByTest.java | 1 -
.../rest/test/resource/model/ApiResponse.java | 3 -
.../rest/test/resource/model/Collection.java | 3 -
.../cassandra/AccountCreationPropsImpl.java | 2 +-
.../cassandra/ManagementServiceImpl.java | 4 +-
.../AwsPropertiesNotFoundException.java | 3 -
.../notifications/ApplicationQueueMessage.java | 3 -
.../notifications/NotificationServiceProxy.java | 3 -
131 files changed, 857 insertions(+), 756 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 b0a5f08..af933f6 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
@@ -211,8 +211,8 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
// exception here. We don't want to cause job loss, so leave the job in
// the Q.
logger.error(
- "Unable to retrieve job data for jobname {}, job id {}, stats id {}. Skipping to avoid job "
- + "loss", new Object[] { jobName, jobUuid, statsUuid, e } );
+ "Unable to retrieve job data for jobname {}, job id {}, stats id {}. Skipping to avoid job loss",
+ jobName, jobUuid, statsUuid, e );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/clustering/hazelcast/HazelcastLifecycleMonitor.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/clustering/hazelcast/HazelcastLifecycleMonitor.java b/stack/core/src/main/java/org/apache/usergrid/clustering/hazelcast/HazelcastLifecycleMonitor.java
index 7af19b3..0c436f6 100644
--- a/stack/core/src/main/java/org/apache/usergrid/clustering/hazelcast/HazelcastLifecycleMonitor.java
+++ b/stack/core/src/main/java/org/apache/usergrid/clustering/hazelcast/HazelcastLifecycleMonitor.java
@@ -55,25 +55,25 @@ public class HazelcastLifecycleMonitor implements InstanceListener, MembershipLi
@Override
public void instanceCreated( InstanceEvent event ) {
Instance instance = event.getInstance();
- logger.info( "Created instance ID: [" + instance.getId() + "] Type: [" + instance.getInstanceType() + "]" );
+ logger.info( "Created instance ID: [{}] Type: [{}]", instance.getId(), instance.getInstanceType() );
}
@Override
public void instanceDestroyed( InstanceEvent event ) {
Instance instance = event.getInstance();
- logger.info( "Destroyed isntance ID: [" + instance.getId() + "] Type: [" + instance.getInstanceType() + "]" );
+ logger.info( "Destroyed instance ID: [{}] Type: [{}]", instance.getId(), instance.getInstanceType() );
}
@Override
public void memberAdded( MembershipEvent membersipEvent ) {
- logger.info( "MemberAdded " + membersipEvent );
+ logger.info( "MemberAdded {}", membersipEvent );
}
@Override
public void memberRemoved( MembershipEvent membersipEvent ) {
- logger.info( "MemberRemoved " + membersipEvent );
+ logger.info( "MemberRemoved {}", membersipEvent );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 d51131e..ed1d2de 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
@@ -443,9 +443,7 @@ public class CpEntityManager implements EntityManager {
if ( cpEntity == null ) {
if ( logger.isDebugEnabled() ) {
logger.debug( "FAILED to load entity {}:{} from app {}",
- new Object[] {
- id.getType(), id.getUuid(), applicationId
- } );
+ id.getType(), id.getUuid(), applicationId );
}
return null;
}
@@ -466,7 +464,7 @@ public class CpEntityManager implements EntityManager {
}
catch ( ClassCastException e1 ) {
logger.error( "Unable to get typed entity: {} of class {}",
- new Object[] { entityId, entityClass.getCanonicalName(), e1 } );
+ entityId, entityClass.getCanonicalName(), e1 );
}
return e;
}
@@ -500,9 +498,8 @@ public class CpEntityManager implements EntityManager {
if ( cpEntity == null ) {
if ( logger.isDebugEnabled() ) {
logger.debug( "FAILED to load entity {}:{} from app {}\n",
- new Object[] {
id.getType(), id.getUuid(), applicationId
- } );
+ );
}
return null;
}
@@ -558,11 +555,9 @@ public class CpEntityManager implements EntityManager {
if ( logger.isDebugEnabled() ) {
logger.debug( "Updating entity {}:{} app {}\n",
- new Object[] {
entityId.getType(),
entityId.getUuid(),
- appId
- } );
+ appId );
}
// if ( !UUIDUtils.isTimeBased( entityId.getUuid() ) ) {
@@ -588,9 +583,9 @@ public class CpEntityManager implements EntityManager {
// cpEntity = ecm.load( entityId ).toBlockingObservable().last();
if (logger.isDebugEnabled()) {
- logger.debug("Wrote {}:{} version {}", new Object[]{
+ logger.debug("Wrote {}:{} version {}",
cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
- });
+ );
}
}
catch ( WriteUniqueVerifyException wuve ) {
@@ -686,14 +681,14 @@ public class CpEntityManager implements EntityManager {
}
catch ( Exception e ) {
logger.error( "Unable to decrement counter application.collection: {}.",
- new Object[] { collection_name, e } );
+ collection_name, e );
}
try {
incrementAggregateCounters( null, null, null, APPLICATION_ENTITIES, -ONE_COUNT, cassandraTimestamp );
}
catch ( Exception e ) {
- logger.error( "Unable to decrement counter application.entities for collection: {} " + "with timestamp: {}",
- new Object[] { collection_name, cassandraTimestamp, e } );
+ logger.error( "Unable to decrement counter application.entities for collection: {} with timestamp: {}",
+ collection_name, cassandraTimestamp, e );
}
}
@@ -851,8 +846,8 @@ public class CpEntityManager implements EntityManager {
Assert.notNull( collectionType, "collectionType is required" );
Assert.notNull( aliasValue, "aliasValue is required" );
- if (logger.isDebugEnabled()) {
- logger.debug("getAlias() for collection type {} alias {}", collectionType, aliasValue);
+ if (logger.isTraceEnabled()) {
+ logger.trace("getAlias() for collection type {} alias {}", collectionType, aliasValue);
}
String collName = Schema.defaultCollectionName( collectionType );
@@ -866,9 +861,8 @@ public class CpEntityManager implements EntityManager {
// add a warn statement so we can see if we have data migration issues.
// TODO When we get an event system, trigger a repair if this is detected
if ( results.size() > 1 ) {
- logger.warn( "More than 1 entity with Owner id '{}' of type '{}' "
- + "and alias '{}' exists. This is a duplicate alias, and needs audited",
- new Object[] { ownerRef, collectionType, aliasValue } );
+ logger.warn( "More than 1 entity with Owner id '{}' of type '{}' and alias '{}' exists. This is a duplicate alias, and needs audited",
+ ownerRef, collectionType, aliasValue );
}
return results.get(aliasValue);
@@ -888,8 +882,8 @@ public class CpEntityManager implements EntityManager {
public Map<String, EntityRef> getAlias( EntityRef ownerRef, String collName, List<String> aliases )
throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("getAliases() for collection {} aliases {}", collName, aliases);
+ if (logger.isTraceEnabled()) {
+ logger.trace("getAliases() for collection {} aliases {}", collName, aliases);
}
Assert.notNull( ownerRef, "ownerRef is required" );
@@ -946,8 +940,8 @@ public class CpEntityManager implements EntityManager {
get( entityRef ).getType();
}
catch ( Exception e ) {
- logger.error( "Unable to load entity " + entityRef.getType()
- + ":" + entityRef.getUuid(), e );
+ logger.error( "Unable to load entity {}:{}", entityRef.getType(),
+ entityRef.getUuid(), e );
}
if ( entityRef == null ) {
throw new EntityNotFoundException(
@@ -1075,19 +1069,17 @@ public class CpEntityManager implements EntityManager {
cpEntity.removeField( propertyName );
- if(logger.isDebugEnabled()){
- logger.debug( "About to Write {}:{} version {}", new Object[] {
- cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
- } );
+ if(logger.isTraceEnabled()){
+ logger.trace( "About to Write {}:{} version {}",
+ cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion() );
}
//TODO: does this call and others like it need a graphite reporter?
cpEntity = ecm.write( cpEntity ).toBlocking().last();
- if(logger.isDebugEnabled()){
- logger.debug("Wrote {}:{} version {}", new Object[]{
- cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
- });
+ if(logger.isTraceEnabled()){
+ logger.trace("Wrote {}:{} version {}",
+ cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion() );
}
//Adding graphite metrics
@@ -1820,7 +1812,7 @@ public class CpEntityManager implements EntityManager {
.addToCollection( COLLECTION_ROLES, entity );
logger.info( "Created role {} with id {} in group {}",
- new String[] { roleName, entity.getUuid().toString(), groupId.toString() } );
+ roleName, entity.getUuid().toString(), groupId.toString() );
return entity;
}
@@ -2160,8 +2152,8 @@ public class CpEntityManager implements EntityManager {
return null;
}
- if(logger.isDebugEnabled()){
- logger.debug( "getUserByIdentifier {}:{}", identifier.getType(), identifier.toString() );
+ if(logger.isTraceEnabled()){
+ logger.trace( "getUserByIdentifier {}:{}", identifier.getType(), identifier.toString() );
}
if ( identifier.isUUID() ) {
@@ -2608,32 +2600,28 @@ public class CpEntityManager implements EntityManager {
// prepare to write and index Core Persistence Entity into default scope
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Writing entity {}:{} into app {}\n",
- new Object[] {
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Writing entity {}:{} into app {}\n",
entity.getType(),
entity.getUuid(),
applicationId,
- CpEntityMapUtils.toMap( cpEntity )
- } );
+ CpEntityMapUtils.toMap( cpEntity ));
}
try {
- if(logger.isDebugEnabled()) {
- logger.debug( "About to Write {}:{} version {}", new Object[] {
- cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
- } );
+ if(logger.isTraceEnabled()) {
+ logger.trace( "About to Write {}:{} version {}",
+ cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion() );
}
cpEntity = ecm.write( cpEntity ).toBlocking().last();
entity.setSize(cpEntity.getSize());
- if(logger.isDebugEnabled()) {
- logger.debug( "Wrote {}:{} version {}", new Object[] {
- cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
- } );
+ if(logger.isTraceEnabled()) {
+ logger.trace( "Wrote {}:{} version {}",
+ cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion() );
}
}
@@ -2672,16 +2660,15 @@ public class CpEntityManager implements EntityManager {
}
catch ( Exception e ) {
logger.error( "Unable to increment counter application.collection: {}.",
- new Object[] { collection_name, e } );
+ collection_name, e );
}
try {
incrementAggregateCounters( null, null, null,
APPLICATION_ENTITIES, ONE_COUNT, cassandraTimestamp );
}
catch ( Exception e ) {
- logger.error( "Unable to increment counter application.entities for collection: "
- + "{} with timestamp: {}",
- new Object[] { collection_name, cassandraTimestamp, e } );
+ logger.error( "Unable to increment counter application.entities for collection: {} with timestamp: {}",
+ collection_name, cassandraTimestamp, e );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 e3a0933..0462ac6 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
@@ -226,7 +226,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
if (logger.isDebugEnabled()) {
logger.debug("New application orgName {} orgAppName {} id {} ",
- new Object[]{orgName, name, applicationId.toString()});
+ orgName, name, applicationId.toString());
}
return initializeApplicationV2( orgName, applicationId, appName, properties, forMigration);
@@ -481,7 +481,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
if (logger.isDebugEnabled()) {
logger.debug("getApplications(): Loading edges of edgeType {} from {}:{}",
- new Object[]{edgeType, managementId.getType(), managementId.getUuid()});
+ edgeType, managementId.getType(), managementId.getUuid());
}
Observable<MarkedEdge> edges = gm.loadEdgesFromSource(
@@ -621,7 +621,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
results = em.searchCollection( em.getApplicationRef(), "propertymaps", q);
} catch (Exception ex) {
- logger.error("Error getting service property for delete of property: " + name, ex);
+ logger.error("Error getting service property for delete of property: {}", name, ex);
return false;
}
@@ -639,7 +639,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
em.update( propsEntity );
} catch (Exception ex) {
- logger.error("Error deleting service property orgAppName: " + name, ex);
+ logger.error("Error deleting service property orgAppName: {}", name, ex);
return false;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 fa15f8f..cfb8dfa 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
@@ -155,9 +155,9 @@ public class CpRelationManager implements RelationManager {
this.connectionService = connectionService;
if ( logger.isDebugEnabled() ) {
- logger.debug( "Loading head entity {}:{} from app {}", new Object[] {
+ logger.debug( "Loading head entity {}:{} from app {}",
headEntity.getType(), headEntity.getUuid(), applicationScope
- } );
+ );
}
Id entityId = new SimpleId( headEntity.getUuid(), headEntity.getType() );
@@ -178,10 +178,9 @@ public class CpRelationManager implements RelationManager {
String edgeTypePrefix = CpNamingUtils.getEdgeTypeFromCollectionName( collectionName );
- if (logger.isDebugEnabled()) {
- logger.debug("getCollectionIndexes(): Searching for edge type prefix {} to target {}:{}", new Object[]{
- edgeTypePrefix, cpHeadEntity.getId().getType(), cpHeadEntity.getId().getUuid()
- });
+ if (logger.isTraceEnabled()) {
+ logger.trace("getCollectionIndexes(): Searching for edge type prefix {} to target {}:{}",
+ edgeTypePrefix, cpHeadEntity.getId().getType(), cpHeadEntity.getId().getUuid() );
}
Observable<Set<String>> types =
@@ -264,10 +263,9 @@ public class CpRelationManager implements RelationManager {
Id entityId = new SimpleId( entity.getUuid(), entity.getType() );
- if (logger.isDebugEnabled()) {
- logger.debug("isConnectionMember(): Checking for edge type {} from {}:{} to {}:{}", new Object[]{
- connectionType, headEntity.getType(), headEntity.getUuid(), entity.getType(), entity.getUuid()
- });
+ if (logger.isTraceEnabled()) {
+ logger.trace("isConnectionMember(): Checking for edge type {} from {}:{} to {}:{}",
+ connectionType, headEntity.getType(), headEntity.getUuid(), entity.getType(), entity.getUuid() );
}
GraphManager gm = managerCache.getGraphManager( applicationScope );
@@ -285,10 +283,9 @@ public class CpRelationManager implements RelationManager {
Id entityId = new SimpleId( entity.getUuid(), entity.getType() );
- if (logger.isDebugEnabled()) {
- logger.debug("isCollectionMember(): Checking for edge type {} from {}:{} to {}:{}", new Object[]{
- collectionName, headEntity.getType(), headEntity.getUuid(), entity.getType(), entity.getUuid()
- });
+ if (logger.isTraceEnabled()) {
+ logger.trace("isCollectionMember(): Checking for edge type {} from {}:{} to {}:{}",
+ collectionName, headEntity.getType(), headEntity.getUuid(), entity.getType(), entity.getUuid() );
}
GraphManager gm = managerCache.getGraphManager( applicationScope );
@@ -384,9 +381,8 @@ public class CpRelationManager implements RelationManager {
}
if ( logger.isDebugEnabled() ) {
- logger.debug( "Loaded member entity {}:{} from app {}\n " + " data {}", new Object[] {
- itemRef.getType(), itemRef.getUuid(), applicationScope, CpEntityMapUtils.toMap( memberEntity )
- } );
+ logger.debug( "Loaded member entity {}:{} from app {}\n data {}",
+ itemRef.getType(), itemRef.getUuid(), applicationScope, CpEntityMapUtils.toMap( memberEntity ) );
}
@@ -411,9 +407,8 @@ public class CpRelationManager implements RelationManager {
} ).doOnCompleted( () -> {
indexService.queueNewEdge( applicationScope, memberEntity, edge );
if ( logger.isDebugEnabled() ) {
- logger.debug( "Added entity {}:{} to collection {}", new Object[] {
- itemRef.getUuid().toString(), itemRef.getType(), collectionName
- } );
+ logger.debug( "Added entity {}:{} to collection {}",
+ itemRef.getUuid().toString(), itemRef.getType(), collectionName );
}
} ).toBlocking().lastOrDefault( null );
@@ -423,9 +418,8 @@ public class CpRelationManager implements RelationManager {
if ( logger.isDebugEnabled() ) {
- logger.debug( "Added entity {}:{} to collection {}", new Object[] {
- itemRef.getUuid().toString(), itemRef.getType(), collectionName
- } );
+ logger.debug( "Added entity {}:{} to collection {}",
+ itemRef.getUuid().toString(), itemRef.getType(), collectionName );
}
@@ -506,9 +500,8 @@ public class CpRelationManager implements RelationManager {
if ( logger.isDebugEnabled() ) {
- logger.debug( "Loading entity to remove from collection " + "{}:{} from app {}\n", new Object[] {
- itemRef.getType(), itemRef.getUuid(), applicationScope
- } );
+ logger.debug( "Loading entity to remove from collection {}:{} from app {}\n",
+ itemRef.getType(), itemRef.getUuid(), applicationScope );
}
Id entityId = new SimpleId( itemRef.getUuid(), itemRef.getType() );
@@ -650,11 +643,8 @@ public class CpRelationManager implements RelationManager {
Thread.sleep( sleepTime );
}
while ( !found && length <= maxLength );
- if ( logger.isInfoEnabled() ) {
- logger.info( String
- .format( "Consistent Search finished in %s, results=%s, expected=%s...dumping stack", length,
- results.size(), expectedResults ) );
- }
+ logger.info( "Consistent Search finished in {}, results={}, expected={}...dumping stack",
+ length, results.size(), expectedResults );
return results;
}
@@ -675,12 +665,10 @@ public class CpRelationManager implements RelationManager {
ConnectionRefImpl connection = new ConnectionRefImpl( headEntity, connectionType, connectedEntityRef );
- if ( logger.isDebugEnabled() ) {
- logger.debug( "createConnection(): " + "Indexing connection type '{}'\n from source {}:{}]\n"
- + " to target {}:{}\n app {}", new Object[] {
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "createConnection(): Indexing connection type '{}'\n from source {}:{}]\n to target {}:{}\n app {}",
connectionType, headEntity.getType(), headEntity.getUuid(), connectedEntityRef.getType(),
- connectedEntityRef.getUuid(), applicationScope
- } );
+ connectedEntityRef.getUuid(), applicationScope );
}
final Id entityId = new SimpleId( connectedEntityRef.getUuid(), connectedEntityRef.getType() );
@@ -758,11 +746,10 @@ public class CpRelationManager implements RelationManager {
String connectionType = connectionRef.getTargetRefs().getConnectionType();
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Deleting connection '{}' from source {}:{} \n to target {}:{}", new Object[] {
+ if ( logger.isTraceEnabled() ) {
+ logger.trace( "Deleting connection '{}' from source {}:{} \n to target {}:{}",
connectionType, connectingEntityRef.getType(), connectingEntityRef.getUuid(),
- connectedEntityRef.getType(), connectedEntityRef.getUuid()
- } );
+ connectedEntityRef.getType(), connectedEntityRef.getUuid() );
}
Id entityId = new SimpleId( connectedEntityRef.getUuid(), connectedEntityRef.getType() );
@@ -859,8 +846,8 @@ public class CpRelationManager implements RelationManager {
for ( EntityRef ref : containers.keySet() ) {
Entity entity = em.get( ref );
- if (logger.isDebugEnabled()) {
- logger.debug(" Found connecting entity: " + entity.getProperties());
+ if (logger.isTraceEnabled()) {
+ logger.trace(" Found connecting entity: " + entity.getProperties());
}
entities.add( entity );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
index 035518e..e97be3f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpSetup.java
@@ -171,7 +171,7 @@ public class CpSetup implements Setup {
// Need this legacy stuff for queues
- logger.info( "Creating static application keyspace " + getApplicationKeyspace() );
+ logger.info( "Creating static application keyspace {}", getApplicationKeyspace() );
cass.createColumnFamily( getApplicationKeyspace(),
createColumnFamilyDefinition( getApplicationKeyspace(), APPLICATIONS_CF,
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 b5b27ac..25ff977 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
@@ -80,12 +80,11 @@ public class CpWalker {
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;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 3d63ea4..b3ce43b 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
@@ -103,7 +103,7 @@ public class GuiceFactory implements FactoryBean<Injector> {
hostsString = hostsString.substring( 0, hostsString.length() - 1 );
- logger.info( "hostsString: " + hostsString );
+ logger.info( "hostsString: {}", hostsString );
Properties cpProps = new Properties();
@@ -120,7 +120,7 @@ public class GuiceFactory implements FactoryBean<Injector> {
getAndValidateProperty( "cassandra.keyspace.replication" ) );
if (logger.isDebugEnabled()) {
- logger.debug("Set Cassandra properties for Core Persistence: " + cpProps.toString());
+ logger.debug("Set Cassandra properties for Core Persistence: {}", cpProps.toString());
}
// Make all Usergrid properties into Core Persistence config
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 542e54a..00dc69a 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
@@ -358,7 +358,7 @@ public class AmazonAsyncEventService implements AsyncEventService {
return new IndexEventResult(Optional.fromNullable(message),
Optional.fromNullable(indexOperationMessage), thisEvent.getCreationTime());
} catch (Exception e) {
- logger.error("Failed to index message: " + message.getMessageId(), message.getStringBody(), e);
+ logger.error("Failed to index message: {} {}", message.getMessageId(), message.getStringBody(), e);
return new IndexEventResult(Optional.absent(), Optional.<IndexOperationMessage>absent(),
event.getCreationTime());
}
@@ -729,9 +729,8 @@ public class AmazonAsyncEventService implements AsyncEventService {
submitToIndex( indexEventResults );
if ( messagesToAck == null || messagesToAck.size() == 0 ) {
logger.error(
- "No messages came back from the queue operation should "
- + "have seen "
- + messages.size(), messages );
+ "No messages came back from the queue operation, should have seen {} messages",
+ messages.size() );
return messagesToAck;
}
if ( messagesToAck.size() < messages.size() ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 813436f..4e476db 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
@@ -54,7 +54,7 @@ import rx.Observable;
@Singleton
public class EventBuilderImpl implements EventBuilder {
- private static final Logger log = LoggerFactory.getLogger( EventBuilderImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( EventBuilderImpl.class );
private final IndexService indexService;
private final EntityCollectionManagerFactory entityCollectionManagerFactory;
@@ -79,8 +79,8 @@ public class EventBuilderImpl implements EventBuilder {
//process the entity immediately
//only process the same version, otherwise ignore
- if (log.isDebugEnabled()) {
- log.debug("Indexing in app scope {} entity {}", entity, applicationScope);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Indexing in app scope {} entity {}", entity, applicationScope);
}
return indexService.indexEntity( applicationScope, entity );
@@ -91,9 +91,9 @@ public class EventBuilderImpl implements EventBuilder {
public Observable<IndexOperationMessage> buildNewEdge( final ApplicationScope applicationScope, final Entity entity,
final Edge newEdge ) {
- if (log.isDebugEnabled()) {
- log.debug("Indexing in app scope {} with entity {} and new edge {}",
- new Object[]{entity, applicationScope, newEdge});
+ if (logger.isDebugEnabled()) {
+ logger.debug("Indexing in app scope {} with entity {} and new edge {}",
+ applicationScope, entity, newEdge);
}
return indexService.indexEdge( applicationScope, entity, newEdge );
@@ -103,17 +103,14 @@ public class EventBuilderImpl implements EventBuilder {
@Override
public Observable<IndexOperationMessage> buildDeleteEdge( final ApplicationScope applicationScope, final Edge
edge ) {
- if (log.isDebugEnabled()) {
- log.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> edgeObservable =
- indexService.deleteIndexEdge( applicationScope, edge ).flatMap( batch -> {
- final GraphManager gm = graphManagerFactory.createEdgeManager( applicationScope );
- return gm.deleteEdge( edge ).map( deletedEdge -> batch );
- } );
-
- return edgeObservable;
+ return indexService.deleteIndexEdge( applicationScope, edge ).flatMap( batch -> {
+ final GraphManager gm = graphManagerFactory.createEdgeManager( applicationScope );
+ return gm.deleteEdge( edge ).map( deletedEdge -> batch );
+ } );
}
@@ -122,8 +119,8 @@ public class EventBuilderImpl implements EventBuilder {
@Override
public EntityDeleteResults buildEntityDelete( final ApplicationScope applicationScope, final Id entityId ) {
- if (log.isDebugEnabled()) {
- log.debug("Deleting entity id from index in app scope {} with entityId {} }", applicationScope, entityId);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Deleting entity id from index in app scope {} with entityId {}", applicationScope, entityId);
}
final EntityCollectionManager ecm = entityCollectionManagerFactory.createCollectionManager( applicationScope );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
index f108f37..da2ef1d 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
@@ -127,9 +127,7 @@ public class ReIndexServiceImpl implements ReIndexService {
.buffer( indexProcessorFig.getReindexBufferSize())
.doOnNext(edges -> {
- if(logger.isInfoEnabled()) {
- logger.info("Sending batch of {} to be indexed.", edges.size());
- }
+ logger.info("Sending batch of {} to be indexed.", edges.size());
indexService.indexBatch(edges, modifiedSince);
});
@@ -285,7 +283,7 @@ public class ReIndexServiceImpl implements ReIndexService {
if(logger.isDebugEnabled()) {
logger.debug( "Flushing state for jobId {}, status {}, processedCount {}, lastUpdated {}",
- new Object[] { jobId, status, processedCount, lastUpdated } );
+ jobId, status, processedCount, lastUpdated);
}
mapManager.putString( jobId + MAP_STATUS_KEY, status.name() );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/AbstractElasticSearchFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/AbstractElasticSearchFilter.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/AbstractElasticSearchFilter.java
index b0a6a6b..deba16a 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/AbstractElasticSearchFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/AbstractElasticSearchFilter.java
@@ -45,7 +45,7 @@ import java.util.Collection;
*/
public abstract class AbstractElasticSearchFilter extends AbstractPathFilter<Id, Candidate, Integer> {
- private static final Logger log = LoggerFactory.getLogger( AbstractElasticSearchFilter.class );
+ private static final Logger logger = LoggerFactory.getLogger( AbstractElasticSearchFilter.class );
private final EntityIndexFactory entityIndexFactory;
private final IndexLocationStrategyFactory indexLocationStrategyFactory;
@@ -139,7 +139,7 @@ public abstract class AbstractElasticSearchFilter extends AbstractPathFilter<Id,
}
catch ( Throwable t ) {
- log.error( "Unable to search candidates", t );
+ logger.error( "Unable to search candidates", t );
subscriber.onError( t );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateEntityFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateEntityFilter.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateEntityFilter.java
index 449639c..bf444b5 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateEntityFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateEntityFilter.java
@@ -211,8 +211,7 @@ public class CandidateEntityFilter extends AbstractFilter<FilterResult<Candidate
//doesn't exist warn and drop
if ( entity == null ) {
logger.warn(
- "Searched and received candidate with entityId {} and version {}, yet was not found in cassandra."
- + " Ignoring since this could be a region sync issue",
+ "Searched and received candidate with entityId {} and version {}, yet was not found in cassandra. Ignoring since this could be a region sync issue",
candidateId, candidateVersion );
@@ -234,7 +233,7 @@ public class CandidateEntityFilter extends AbstractFilter<FilterResult<Candidate
if ( UUIDComparator.staticCompare( entityVersion, candidateVersion ) > 0 || !entity.getEntity().isPresent()) {
logger.warn( "Deindexing stale entity on edge {} for entityId {} and version {}",
- new Object[] { searchEdge, entityId, entityVersion } );
+ searchEdge, entityId, entityVersion);
batch.deindex( searchEdge, entityId, candidateVersion );
return;
}
@@ -244,8 +243,8 @@ public class CandidateEntityFilter extends AbstractFilter<FilterResult<Candidate
if ( UUIDComparator.staticCompare( candidateVersion, entityVersion ) > 0 ) {
logger.warn(
- "Found a newer version in ES over cassandra for edge {} for entityId {} and version {}. Repair "
- + "should be run", new Object[] { searchEdge, entityId, entityVersion } );
+ "Found a newer version in ES over cassandra for edge {} for entityId {} and version {}. Repair should be run",
+ searchEdge, entityId, entityVersion);
//TODO trigger an audit after a fail count where we explicitly try to repair from other regions
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateIdFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateIdFilter.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateIdFilter.java
index 51cc0d0..96849f8 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateIdFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/CandidateIdFilter.java
@@ -173,7 +173,7 @@ public class CandidateIdFilter extends AbstractFilter<FilterResult<Candidate>, F
if ( UUIDComparator.staticCompare( entityVersion, candidateVersion ) > 0 ) {
logger.warn( "Deindexing stale entity on edge {} for entityId {} and version {}",
- new Object[] { searchEdge, entityId, entityVersion } );
+ searchEdge, entityId, entityVersion );
batch.deindex( searchEdge, entityId, entityVersion );
return;
}
@@ -183,8 +183,8 @@ public class CandidateIdFilter extends AbstractFilter<FilterResult<Candidate>, F
if ( UUIDComparator.staticCompare( candidateVersion, entityVersion ) > 0 ) {
logger.warn(
- "Found a newer version in ES over cassandra for edge {} for entityId {} and version {}. Repair "
- + "should be run", new Object[] { searchEdge, entityId, entityVersion } );
+ "Found a newer version in ES over cassandra for edge {} for entityId {} and version {}. Repair should be run",
+ searchEdge, entityId, entityVersion );
}
//they're the same add it
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/SearchConnectionFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/SearchConnectionFilter.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/SearchConnectionFilter.java
index 27a12a8..d484ade 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/SearchConnectionFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/search/SearchConnectionFilter.java
@@ -60,16 +60,12 @@ public class SearchConnectionFilter extends AbstractElasticSearchFilter {
@Override
protected SearchTypes getSearchTypes() {
- final SearchTypes searchTypes = SearchTypes.fromNullableTypes( connectedEntityType.orNull() );
-
- return searchTypes;
+ return SearchTypes.fromNullableTypes( connectedEntityType.orNull() );
}
@Override
protected SearchEdge getSearchEdge( final Id id ) {
- final SearchEdge searchEdge = createConnectionSearchEdge( id, connectionName );
-
- return searchEdge;
+ return createConnectionSearchEdge( id, connectionName );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 ba32a01..fb4a7dc 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
@@ -41,7 +41,7 @@ import static org.apache.usergrid.persistence.cassandra.Serializers.*;
* @author zznate
*/
public class CassandraCounterStore implements CounterStore {
- private static final Logger log = LoggerFactory.getLogger( CassandraCounterStore.class );
+ private static final Logger logger = LoggerFactory.getLogger( CassandraCounterStore.class );
// keep track of exceptions thrown in scheduler so we can reduce noise in logs
private Map<String, Integer> counterInsertFailures = new HashMap<String, Integer>();
@@ -84,14 +84,14 @@ public class CassandraCounterStore implements CounterStore {
// errors here happen a lot on shutdown, don't fill the logs with them
String error = e.getClass().getCanonicalName();
if (counterInsertFailures.get( error ) == null) {
- log.error( "CounterStore insert failed, first instance", e);
+ logger.error( "CounterStore insert failed, first instance", e);
counterInsertFailures.put( error, 1);
} else {
int count = counterInsertFailures.get(error) + 1;
counterInsertFailures.put(error, count);
- log.error(error + " caused CounterStore insert failure, count = " + count, e);
+ logger.error("{} caused CounterStore insert failure, count = {}", error, count, e);
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/count/CassandraSubmitter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/count/CassandraSubmitter.java b/stack/core/src/main/java/org/apache/usergrid/count/CassandraSubmitter.java
index 5323e1c..7fc7fa1 100644
--- a/stack/core/src/main/java/org/apache/usergrid/count/CassandraSubmitter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/count/CassandraSubmitter.java
@@ -39,7 +39,7 @@ import com.yammer.metrics.core.TimerContext;
* @author zznate
*/
public class CassandraSubmitter implements BatchSubmitter {
- private static final Logger log = LoggerFactory.getLogger( CassandraSubmitter.class );
+ private static final Logger logger = LoggerFactory.getLogger( CassandraSubmitter.class );
private final int threadCount = 3;
private final CassandraCounterStore cassandraCounterStore;
@@ -72,7 +72,7 @@ public class CassandraSubmitter implements BatchSubmitter {
@Override
public void shutdown() {
- log.warn( "Shutting down CassandraSubmitter" );
+ logger.warn( "Shutting down CassandraSubmitter" );
executor.shutdown();
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/mq/CounterQuery.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/CounterQuery.java b/stack/core/src/main/java/org/apache/usergrid/mq/CounterQuery.java
index c29c08c..1ce06bc 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/CounterQuery.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/CounterQuery.java
@@ -21,8 +21,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.usergrid.mq.Query.CounterFilterPredicate;
import org.apache.usergrid.persistence.index.query.CounterResolution;
import org.apache.usergrid.utils.JsonUtils;
@@ -36,8 +34,6 @@ import static org.apache.usergrid.utils.MapUtils.toMapList;
public class CounterQuery {
- public static final Logger logger = LoggerFactory.getLogger( CounterQuery.class );
-
public static final int DEFAULT_MAX_RESULTS = 10;
private int limit = 0;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/mq/Query.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/Query.java b/stack/core/src/main/java/org/apache/usergrid/mq/Query.java
index 674695c..bde0315 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/Query.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/Query.java
@@ -158,7 +158,7 @@ public class Query {
return q;
}
catch ( Exception e ) {
- logger.error( "Unable to parse \"" + ql + "\"", e );
+ logger.error( "Unable to parse \"{}\"", ql, e );
}
return null;
}
@@ -584,7 +584,7 @@ public class Query {
for ( SortPredicate s : sortPredicates ) {
if ( s.getPropertyName().equals( propertyName ) ) {
logger.error(
- "Attempted to set sort order for " + s.getPropertyName() + " more than once, discardng..." );
+ "Attempted to set sort order for {} more than once, discarding...", s.getPropertyName() );
return this;
}
}
@@ -600,7 +600,7 @@ public class Query {
for ( SortPredicate s : sortPredicates ) {
if ( s.getPropertyName().equals( sort.getPropertyName() ) ) {
logger.error(
- "Attempted to set sort order for " + s.getPropertyName() + " more than once, discardng..." );
+ "Attempted to set sort order for {} more than once, discarding...", s.getPropertyName() );
return this;
}
}
@@ -642,8 +642,7 @@ public class Query {
for ( FilterPredicate f : filterPredicates ) {
if ( f.getPropertyName().equals( propertyName ) && f.getValue().equals( value ) && "*"
.equals( value ) ) {
- logger.error( "Attempted to set wildcard wilder for " + f.getPropertyName()
- + " more than once, discardng..." );
+ logger.error( "Attempted to set wildcard wilder for {} more than once, discarding...", f.getPropertyName());
return this;
}
}
@@ -676,8 +675,7 @@ public class Query {
if ( f.getPropertyName().equals( filter.getPropertyName() ) && f.getValue()
.equals( filter.getValue() ) && "*"
.equals( filter.getValue() ) ) {
- logger.error( "Attempted to set wildcard wilder for " + f.getPropertyName()
- + " more than once, discardng..." );
+ logger.error( "Attempted to set wildcard wilder for {} more than once, discarding...", f.getPropertyName());
return this;
}
}
@@ -685,7 +683,7 @@ public class Query {
}
}
else {
- logger.error( "Unable to add filter to query: " + filterStr );
+ logger.error( "Unable to add filter to query: {}", filterStr );
}
return this;
}
@@ -1518,7 +1516,7 @@ public class Query {
return normalize( filter );
}
catch ( Exception e ) {
- logger.error( "Unable to parse \"" + str + "\"", e );
+ logger.error( "Unable to parse \"{}\"", str, e );
}
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/CassandraMQUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/CassandraMQUtils.java b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/CassandraMQUtils.java
index 0c327df..d48b6d2 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/CassandraMQUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/CassandraMQUtils.java
@@ -62,11 +62,9 @@ public class CassandraMQUtils {
public static void logBatchOperation( String operation, Object columnFamily, Object key, Object columnName,
Object columnValue, long timestamp ) {
- if ( batch_logger.isInfoEnabled() ) {
- batch_logger.info( "{} cf={} key={} name={} value={}", new Object[] {
- operation, columnFamily, key, columnName, columnValue
- } );
- }
+ batch_logger.info( "{} cf={} key={} name={} value={}",
+ operation, columnFamily, key, columnName, columnValue
+ );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 5ec4971..7a85eb6 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
@@ -212,7 +212,7 @@ public class QueueManagerImpl implements QueueManager {
createColumn( QUEUE_NEWEST, messageUuid, newest_ts, se, ue ) );
if (logger.isDebugEnabled()) {
- logger.debug("Writing UUID {} with oldest timestamp {} and newest with timestamp {}", new Object[]{messageUuid, oldest_ts, newest_ts});
+ logger.debug("Writing UUID {} with oldest timestamp {} and newest with timestamp {}", messageUuid, oldest_ts, newest_ts);
}
batch.addInsertion( bytebuffer( getQueueId( "/" ) ), QUEUE_SUBSCRIBERS.getColumnFamily(),
@@ -1042,7 +1042,9 @@ public class QueueManagerImpl implements QueueManager {
public QueueIndexUpdate batchUpdateQueueIndex( QueueIndexUpdate indexUpdate, UUID subcriptionQueueId )
throws Exception {
- logger.info( "batchUpdateQueueIndex" );
+ if (logger.isTraceEnabled()) {
+ logger.trace("batchUpdateQueueIndex");
+ }
Mutator<ByteBuffer> batch = indexUpdate.getBatch();
@@ -1104,11 +1106,9 @@ public class QueueManagerImpl implements QueueManager {
setGreaterThanEqualityFlag( new DynamicComposite( entryName ) ).serialize(), false,
INDEX_ENTRY_LIST_COUNT ).execute().get().getColumns();
- if ( logger.isInfoEnabled() ) {
- logger.info( "Found {} previous index entries for {} of entity {}", new Object[] {
- entries.size(), entryName, queueId
- } );
- }
+ logger.info( "Found {} previous index entries for {} of entity {}",
+ entries.size(), entryName, queueId
+ );
// Delete all matching entries from entry list
for ( HColumn<ByteBuffer, ByteBuffer> entry : entries ) {
@@ -1275,7 +1275,9 @@ public class QueueManagerImpl implements QueueManager {
composite_cursor = "";
}
int hashCode = slice.hashCode();
- logger.info( "Cursor hash code: {} ", hashCode );
+ if (logger.isTraceEnabled()) {
+ logger.trace("Cursor hash code: {} ", hashCode);
+ }
composite_cursor += hashCode + ":" + r.getCursor();
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 7e5cbc0..a1d36a9 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
@@ -203,7 +203,7 @@ public abstract class AbstractSearch implements QueueSearch {
&& comparator.compare( start, finish_uuid ) < 1 ) {
logger.info( "Starting search with start UUID {}, finish UUID {}, and reversed {}",
- new Object[] { lastValue, finish_uuid, params.reversed } );
+ lastValue, finish_uuid, params.reversed );
SliceQuery<ByteBuffer, UUID, ByteBuffer> q = createSliceQuery( ko, be, ue, be );
@@ -299,9 +299,8 @@ public abstract class AbstractSearch implements QueueSearch {
if ( logger.isDebugEnabled() ) {
logger.debug( "Writing last client id pointer of '{}' for queue '{}' and consumer '{}' with timestamp '{}",
- new Object[] {
lastReturnedId, queueId, consumerId, colTimestamp
- } );
+ );
}
mutator.addInsertion( consumerId, CONSUMERS.getColumnFamily(),
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 17d4934..ea8d3fa 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,8 +127,8 @@ public class ConsumerTransaction extends NoTransactionSearch
// Generate a new expiration and insert it
UUID expirationId = UUIDUtils.newTimeUUID( now + query.getTimeout() );
- if (logger.isDebugEnabled()) {
- logger.debug("Writing new timeout at '{}' for message '{}'", expirationId, messageId);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Writing new timeout at '{}' for message '{}'", expirationId, messageId);
}
@@ -350,13 +350,13 @@ public class ConsumerTransaction extends NoTransactionSearch
for ( HColumn<UUID, UUID> column : cassResults )
{
- if ( logger.isDebugEnabled() )
+ if ( logger.isTraceEnabled() )
{
- logger.debug( "Adding uuid '{}' for original message '{}' to results for queue '{}' and consumer '{}'",
- new Object[] { column.getName(), column.getValue(), queueId, consumerId } );
- logger.debug( "Max timeuuid : '{}', Current timeuuid : '{}', comparison '{}'", new Object[] {
+ logger.trace( "Adding uuid '{}' for original message '{}' to results for queue '{}' and consumer '{}'",
+ column.getName(), column.getValue(), queueId, consumerId );
+ logger.trace( "Max timeuuid : '{}', Current timeuuid : '{}', comparison '{}'",
startTimeUUID, column.getName(), UUIDUtils.compare( startTimeUUID, column.getName() )
- } );
+ );
}
results.add( new TransactionPointer( column.getName(), column.getValue() ) );
@@ -400,11 +400,11 @@ public class ConsumerTransaction extends NoTransactionSearch
{
UUID pointer = pointers.get( i ).expiration;
- if ( logger.isDebugEnabled() )
+ if ( logger.isTraceEnabled() )
{
- logger.debug( "Removing transaction pointer '{}' for queue '{}' and consumer '{}'", new Object[] {
+ logger.trace( "Removing transaction pointer '{}' for queue '{}' and consumer '{}'",
pointer, queueId, consumerId
- } );
+ );
}
mutator.addDeletion( key, CONSUMER_QUEUE_TIMEOUTS.getColumnFamily(), pointer, ue, cass.createTimestamp() );
@@ -445,8 +445,8 @@ public class ConsumerTransaction extends NoTransactionSearch
UUID expirationId = UUIDUtils.newTimeUUID( futureTimeout, counter );
UUID messageId = message.getUuid();
- if (logger.isDebugEnabled()) {
- logger.debug("Writing new timeout at '{}' for message '{}'", expirationId, messageId);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Writing new timeout at '{}' for message '{}'", expirationId, messageId);
}
mutator.addInsertion( key, CONSUMER_QUEUE_TIMEOUTS.getColumnFamily(),
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/NoTransactionSearch.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/NoTransactionSearch.java b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/NoTransactionSearch.java
index aa535ef..4e8624f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/NoTransactionSearch.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/io/NoTransactionSearch.java
@@ -89,7 +89,7 @@ public class NoTransactionSearch extends AbstractSearch
if ( logger.isDebugEnabled() )
{
logger.debug( "Last message id is '{}' for queueId '{}' and clientId '{}'",
- new Object[] { lastReadMessageId, queueId, consumerId } );
+ lastReadMessageId, queueId, consumerId );
}
return new SearchParam( lastReadMessageId, false, lastReadMessageId != null, query.getLimit( DEFAULT_READ ) );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 0da0334..6b8f139 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
@@ -559,7 +559,7 @@ public class Schema implements SchemaManager {
return schemaNode;
}
catch ( Exception e ) {
- logger.error( "Unable to get schema for entity type " + entityType, e );
+ logger.error( "Unable to get schema for entity type {}", entityType, e );
}
return null;
}
@@ -1480,7 +1480,7 @@ public class Schema implements SchemaManager {
return;
}
catch ( Exception e ) {
- logger.error( "Unable to set entity property " + property, e );
+ logger.error( "Unable to set entity property {}", property, e );
}
}
try {
@@ -1488,7 +1488,7 @@ public class Schema implements SchemaManager {
return;
}
catch ( Exception e ) {
- logger.error( "Unable to set entity property " + property, e );
+ logger.error( "Unable to set entity property {}", property, e );
}
}
}
@@ -1503,7 +1503,7 @@ public class Schema implements SchemaManager {
return descriptor.getReadMethod().invoke( entity );
}
catch ( Exception e ) {
- logger.error( "Unable to get entity property " + property, e );
+ logger.error( "Unable to get entity property {}", property, e );
}
return null;
}
@@ -1535,7 +1535,7 @@ public class Schema implements SchemaManager {
}
}
catch ( Exception e ) {
- logger.error( "Unable to get entity property " + property, e );
+ logger.error( "Unable to get entity property {}", property, e );
}
}
}
@@ -1607,7 +1607,7 @@ public class Schema implements SchemaManager {
for ( String property_name : required_properties ) {
if ( !columns.containsKey( property_name ) ) {
- logger.error( "Entity (" + entityType + ") missing required property: " + property_name,
+ logger.error( "Entity ({}) missing required property: {}", entityType, property_name,
new Throwable() );
return null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 c94bf59..813fbe8 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
@@ -103,7 +103,7 @@ public class CassandraPersistenceUtils {
if ( batch_logger.isDebugEnabled() ) {
batch_logger.debug( "{} cf={} key={} name={} value={}",
- new Object[] { operation, columnFamily, key, columnName, columnValue } );
+ operation, columnFamily, key, columnName, columnValue );
}
}
@@ -225,8 +225,8 @@ public class CassandraPersistenceUtils {
}
UUID uuid = UUID.nameUUIDFromBytes( keyStr.getBytes() ); //UUIDUtils.newTimeUUID(); //UUID.nameUUIDFromBytes( keyStr.getBytes() );
- if (logger.isDebugEnabled()) {
- logger.debug("Key {} equals UUID {}", keyStr, uuid);
+ if (logger.isTraceEnabled()) {
+ logger.trace("Key {} equals UUID {}", keyStr, uuid);
}
return uuid;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/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 b0226b7..2431533 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
@@ -117,7 +117,7 @@ public class CassandraService {
this.cluster = cluster;
chc = cassandraHostConfigurator;
lockManager = injector.getInstance( LockManager.class );
- db_logger.info( "" + cluster.getKnownPoolHosts( false ) );
+ db_logger.info( "{}", cluster.getKnownPoolHosts( false ) );
//getInjector
applicationKeyspace = injector.getInstance( CassandraFig.class ).getApplicationKeyspace();
}
@@ -385,8 +385,8 @@ public class CassandraService {
Serializer<N> nameSerializer, Serializer<V> valueSerializer )
throws Exception {
- if ( db_logger.isInfoEnabled() ) {
- db_logger.info( "getColumns cf={} key={}", columnFamily, key );
+ if ( db_logger.isTraceEnabled() ) {
+ db_logger.trace( "getColumns cf={} key={}", columnFamily, key );
}
SliceQuery<ByteBuffer, N, V> q = createSliceQuery( ko, be, nameSerializer, valueSerializer );
@@ -397,12 +397,12 @@ public class CassandraService {
ColumnSlice<N, V> slice = r.get();
List<HColumn<N, V>> results = slice.getColumns();
- if ( db_logger.isInfoEnabled() ) {
+ if ( db_logger.isTraceEnabled() ) {
if ( results == null ) {
- db_logger.info( "getColumns returned null" );
+ db_logger.trace( "getColumns returned null" );
}
else {
- db_logger.info( "getColumns returned {} columns", results.size() );
+ db_logger.trace( "getColumns returned {} columns", results.size() );
}
}
@@ -445,7 +445,7 @@ public class CassandraService {
Object finish, int count, boolean reversed )
throws Exception {
- if ( db_logger.isDebugEnabled() ) {
+ if ( db_logger.isTraceEnabled() ) {
db_logger.debug( "getColumns cf=" + columnFamily + " key=" + key + " start=" + start + " finish=" + finish
+ " count=" + count + " reversed=" + reversed );
}
@@ -485,16 +485,12 @@ public class CassandraService {
ColumnSlice<ByteBuffer, ByteBuffer> slice = r.get();
List<HColumn<ByteBuffer, ByteBuffer>> results = slice.getColumns();
- if ( db_logger.isDebugEnabled() ) {
+ if ( db_logger.isTraceEnabled() ) {
if ( results == null ) {
- if (logger.isDebugEnabled()) {
- db_logger.debug("getColumns returned null");
- }
+ db_logger.trace("getColumns returned null");
}
else {
- if (logger.isDebugEnabled()) {
- db_logger.debug("getColumns returned " + results.size() + " columns");
- }
+ db_logger.trace("getColumns returned {} columns", results.size());
}
}
@@ -518,8 +514,8 @@ public class CassandraService {
Serializer<N> nameSerializer, Serializer<V> valueSerializer )
throws Exception {
- if ( db_logger.isDebugEnabled() ) {
- db_logger.debug( "getColumns cf=" + columnFamily + " key=" + key + " names=" + columnNames );
+ if ( db_logger.isTraceEnabled() ) {
+ db_logger.trace( "getColumns cf={} key={} names={}", columnFamily, key, columnNames );
}
SliceQuery<ByteBuffer, N, V> q = createSliceQuery( ko, be, nameSerializer, valueSerializer );
@@ -533,12 +529,12 @@ public class CassandraService {
ColumnSlice<N, V> slice = r.get();
List<HColumn<N, V>> results = slice.getColumns();
- if ( db_logger.isInfoEnabled() ) {
+ if ( db_logger.isTraceEnabled() ) {
if ( results == null ) {
- db_logger.info( "getColumns returned null" );
+ db_logger.trace( "getColumns returned null" );
}
else {
- db_logger.info( "getColumns returned " + results.size() + " columns" );
+ db_logger.trace( "getColumns returned {} columns", results.size());
}
}
@@ -562,8 +558,8 @@ public class CassandraService {
Serializer<N> nameSerializer, Serializer<V> valueSerializer )
throws Exception {
- if ( db_logger.isDebugEnabled() ) {
- db_logger.debug( "getColumn cf=" + columnFamily + " key=" + key + " column=" + column );
+ if ( db_logger.isTraceEnabled() ) {
+ db_logger.trace( "getColumn cf={} key={} column={}", columnFamily, key, column );
}
/*
@@ -577,9 +573,9 @@ public class CassandraService {
q.setKey( bytebuffer( key ) ).setName( column ).setColumnFamily( columnFamily.toString() ).execute();
HColumn<N, V> result = r.get();
- if ( db_logger.isInfoEnabled() ) {
+ if ( db_logger.isTraceEnabled() ) {
if ( result == null ) {
- db_logger.info( "getColumn returned null" );
+ db_logger.trace( "getColumn returned null" );
}
}
@@ -591,8 +587,8 @@ public class CassandraService {
Serializer<N> nameSerializer, Serializer<V> valueSerializer )
throws Exception {
- if ( db_logger.isDebugEnabled() ) {
- db_logger.debug( "getColumn cf=" + columnFamily + " key=" + key + " column=" + columns );
+ if ( db_logger.isTraceEnabled() ) {
+ db_logger.trace( "getColumn cf={} key={} column={}", columnFamily, key, columns );
}
/*
@@ -607,9 +603,9 @@ public class CassandraService {
.execute();
ColumnSlice<N, V> result = r.get();
- if ( db_logger.isDebugEnabled() ) {
+ if ( db_logger.isTraceEnabled() ) {
if ( result == null ) {
- db_logger.debug( "getColumn returned null" );
+ db_logger.trace( "getColumn returned null" );
}
}
@@ -620,9 +616,8 @@ public class CassandraService {
public void setColumn( Keyspace ko, Object columnFamily, Object key, Object columnName, Object columnValue,
int ttl ) throws Exception {
- if ( db_logger.isDebugEnabled() ) {
- db_logger.debug( "setColumn cf=" + columnFamily + " key=" + key + " name=" + columnName + " value="
- + columnValue );
+ if ( db_logger.isTraceEnabled() ) {
+ db_logger.trace( "setColumn cf={} key={} name={} value={}", columnFamily, key, columnName, columnValue );
}
ByteBuffer name_bytes = null;
@@ -655,9 +650,8 @@ public class CassandraService {
public void setColumns( Keyspace ko, Object columnFamily, byte[] key, Map<?, ?> map, int ttl ) throws Exception {
- if ( db_logger.isDebugEnabled() ) {
- db_logger.debug( "setColumns cf=" + columnFamily + " key=" + key + " map=" + map + ( ttl != 0 ?
- " ttl=" + ttl : "" ) );
+ if ( db_logger.isTraceEnabled() ) {
+ db_logger.trace( "setColumns cf={} key={} map={} ttl={}", columnFamily, key, map, ttl);
}
Mutator<ByteBuffer> m = CountingMutator.createFlushingMutator( ko, be );
@@ -718,8 +712,8 @@ public class CassandraService {
*/
public void deleteRow( Keyspace ko, final Object columnFamily, final Object key ) throws Exception {
- if ( db_logger.isDebugEnabled() ) {
- db_logger.debug( "deleteRow cf=" + columnFamily + " key=" + key );
+ if ( db_logger.isTraceEnabled() ) {
+ db_logger.trace( "deleteRow cf={} key={}", columnFamily, key );
}
CountingMutator.createFlushingMutator( ko, be ).addDeletion( bytebuffer( key ), columnFamily.toString() ).execute();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/71fb6100/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ConnectionRefImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ConnectionRefImpl.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ConnectionRefImpl.java
index 1ad9413..f6d2e87 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ConnectionRefImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ConnectionRefImpl.java
@@ -549,11 +549,11 @@ public class ConnectionRefImpl implements ConnectionRef {
byte[] raw_id = byteStream.toByteArray();
- logger.info( "raw connection index id: " + Hex.encodeHexString( raw_id ) );
+ logger.info( "raw connection index id: {}", Hex.encodeHexString( raw_id ) );
uuid = UUID.nameUUIDFromBytes( raw_id );
- logger.info( "connection index uuid: " + uuid );
+ logger.info( "connection index uuid: {}", uuid );
}
catch ( IOException e ) {
logger.error( "Unable to create connection index UUID", e );