You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by mr...@apache.org on 2016/01/08 18:20:56 UTC
[1/7] usergrid git commit: changed LOG and log to logger for
standardizing logging
Repository: usergrid
Updated Branches:
refs/heads/master d6f597ae0 -> 63091f349
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 9cb8e1d..35dcd5c 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
@@ -34,9 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Subscriber;
-import rx.functions.Action1;
import rx.functions.Func1;
-import rx.schedulers.Schedulers;
import java.util.*;
import java.util.concurrent.*;
@@ -45,7 +43,7 @@ import java.util.concurrent.atomic.AtomicInteger;
public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
- private static final Logger LOG = LoggerFactory.getLogger(ApplicationQueueManagerImpl.class);
+ private static final Logger logger = LoggerFactory.getLogger(ApplicationQueueManagerImpl.class);
//this is for tests, will not mark initial post complete, set to false for tests
@@ -85,14 +83,14 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
long startTime = System.currentTimeMillis();
if (notification.getCanceled() == Boolean.TRUE) {
- LOG.info("notification " + notification.getUuid() + " canceled");
+ logger.info("notification " + notification.getUuid() + " canceled");
if (jobExecution != null) {
jobExecution.killed();
}
return;
}
- LOG.info("notification {} start queuing", notification.getUuid());
+ logger.info("notification {} start queuing", notification.getUuid());
final PathQuery<Device> pathQuery = notification.getPathTokens().getPathQuery() ; //devices query
final AtomicInteger deviceCount = new AtomicInteger(); //count devices so you can make a judgement on batching
@@ -102,7 +100,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
//get devices in querystring, and make sure you have access
if (pathQuery != null) {
final HashMap<Object,ProviderAdapter> notifierMap = getAdapterMap();
- LOG.info("notification {} start query", notification.getUuid());
+ logger.info("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) {
@@ -121,13 +119,13 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
long now = System.currentTimeMillis();
List<EntityRef> devicesRef = getDevices(entity); // resolve group
- LOG.info("notification {} queue {} devices, duration "+(System.currentTimeMillis()-now)+" ms", notification.getUuid(), devicesRef.size());
+ logger.info("notification {} queue {} devices, duration "+(System.currentTimeMillis()-now)+" ms", notification.getUuid(), devicesRef.size());
for (EntityRef deviceRef : devicesRef) {
- LOG.info("notification {} starting to queue device {} ", notification.getUuid(), deviceRef.getUuid());
+ logger.info("notification {} starting to queue device {} ", notification.getUuid(), deviceRef.getUuid());
long hash = MurmurHash.hash(deviceRef.getUuid());
if (sketch.estimateCount(hash) > 0) { //look for duplicates
- LOG.warn("Maybe Found duplicate device: {}", deviceRef.getUuid());
+ logger.warn("Maybe Found duplicate device: {}", deviceRef.getUuid());
continue;
} else {
sketch.add(hash, 1);
@@ -145,11 +143,11 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
notifierKey = entry.getKey().toLowerCase();
break;
}
- LOG.info("Provider query for notification {} device {} took "+(System.currentTimeMillis()-now)+" ms",notification.getUuid(),deviceRef.getUuid());
+ logger.info("Provider query for notification {} device {} took "+(System.currentTimeMillis()-now)+" ms",notification.getUuid(),deviceRef.getUuid());
}
if (notifierId == null) {
- LOG.info("Notifier did not match for device {} ", deviceRef);
+ logger.info("Notifier did not match for device {} ", deviceRef);
continue;
}
@@ -158,16 +156,16 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
// update queued time
now = System.currentTimeMillis();
notification.setQueued(System.currentTimeMillis());
- LOG.info("notification {} device {} queue time set. duration "+(System.currentTimeMillis()-now)+" ms", notification.getUuid(), deviceRef.getUuid());
+ logger.info("notification {} device {} queue time set. duration "+(System.currentTimeMillis()-now)+" ms", notification.getUuid(), deviceRef.getUuid());
}
now = System.currentTimeMillis();
qm.sendMessage(message);
- LOG.info("notification {} post-queue to device {} duration " + (System.currentTimeMillis() - now) + " ms "+queueName+" queue", notification.getUuid(), deviceRef.getUuid());
+ logger.info("notification {} post-queue to device {} duration " + (System.currentTimeMillis() - now) + " ms "+queueName+" queue", notification.getUuid(), deviceRef.getUuid());
deviceCount.incrementAndGet();
queueMeter.mark();
}
} catch (Exception deviceLoopException) {
- LOG.error("Failed to add devices", deviceLoopException);
+ logger.error("Failed to add devices", deviceLoopException);
errorMessages.add("Failed to add devices for entity: " + entity.getUuid() + " error:" + deviceLoopException);
}
return entity;
@@ -181,13 +179,13 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
.flatMap(entity -> Observable.just(entity).map(entityListFunct)
.doOnError(throwable -> {
- LOG.error("Failed while writing",
+ logger.error("Failed while writing",
throwable);
})
, 10);
o.toBlocking().lastOrDefault( null );
- LOG.info( "notification {} done queueing duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
+ logger.info( "notification {} done queueing duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
}
// update queued time
@@ -205,7 +203,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
long now = System.currentTimeMillis();
- LOG.info("notification {} updated notification duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
+ logger.info("notification {} updated notification duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
//do i have devices, and have i already started batching.
if (deviceCount.get() <= 0 || !notification.getDebug()) {
@@ -217,7 +215,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
}
long elapsed = notification.getQueued() != null ? notification.getQueued() - startTime : 0;
- LOG.info("notification {} done queuing to {} devices in " + elapsed + " ms", notification.getUuid().toString(), deviceCount.get());
+ logger.info("notification {} done queuing to {} devices in " + elapsed + " ms", notification.getUuid().toString(), deviceCount.get());
}
/**
@@ -246,11 +244,11 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
notifierHashMap.put(uuid, providerAdapter);
notifierHashMap.put(uuid.toString(), providerAdapter);
if(count++ >= 100){
- LOG.error("ApplicationQueueManager: too many notifiers...breaking out ", notifierHashMap.size());
+ logger.error("ApplicationQueueManager: too many notifiers...breaking out ", notifierHashMap.size());
break;
}
}
- LOG.info("ApplicationQueueManager: fetching notifiers finished size={}, duration {} ms", notifierHashMap.size(),System.currentTimeMillis() - now);
+ logger.info("ApplicationQueueManager: fetching notifiers finished size={}, duration {} ms", notifierHashMap.size(),System.currentTimeMillis() - now);
}
return notifierHashMap;
}
@@ -262,7 +260,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
*/
@Override
public Observable sendBatchToProviders(final List<QueueMessage> messages, final String queuePath) {
- LOG.info("sending batch of {} notifications.", messages.size());
+ logger.info("sending batch of {} notifications.", messages.size());
final Map<Object, ProviderAdapter> notifierMap = getAdapterMap();
final ApplicationQueueManagerImpl proxy = this;
@@ -276,7 +274,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
ApplicationQueueMessage message = null;
try {
message = (ApplicationQueueMessage) queueMessage.getBody();
- LOG.info("start sending notification for device {} for Notification: {} on thread "+Thread.currentThread().getId(), message.getDeviceId(), message.getNotificationId());
+ logger.info("start sending notification for device {} for Notification: {} on thread "+Thread.currentThread().getId(), message.getDeviceId(), message.getNotificationId());
UUID deviceUUID = message.getDeviceId();
@@ -294,7 +292,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
final Map<String, Object> payloads = notification.getPayloads();
final Map<String, Object> translatedPayloads = translatePayloads(payloads, notifierMap);
- LOG.info("sending notification for device {} for Notification: {}", deviceUUID, notification.getUuid());
+ logger.info("sending notification for device {} for Notification: {}", deviceUUID, notification.getUuid());
try {
String notifierName = message.getNotifierKey().toLowerCase();
@@ -306,8 +304,8 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
tracker.failed(0, "Notification is duplicate/expired/cancelled.");
}else {
if (payload == null) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("selected device {} for notification {} doesn't have a valid payload. skipping.", deviceUUID, notification.getUuid());
+ if (logger.isDebugEnabled()) {
+ logger.debug("selected device {} for notification {} doesn't have a valid payload. skipping.", deviceUUID, notification.getUuid());
}
tracker.failed(0, "failed to match payload to " + message.getNotifierId() + " notifier");
} else {
@@ -317,7 +315,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
} catch (Exception e) {
tracker.failed(0, e.getMessage());
} finally {
- LOG.info("sending to device {} for Notification: {} duration " + (System.currentTimeMillis() - now) + " ms", deviceUUID, notification.getUuid());
+ logger.info("sending to device {} for Notification: {} duration " + (System.currentTimeMillis() - now) + " ms", deviceUUID, notification.getUuid());
}
}
}
@@ -327,13 +325,13 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
}
} catch (Exception e) {
- LOG.error("Failure while sending",e);
+ logger.error("Failure while sending",e);
try {
if(!messageCommitted && queuePath != null) {
qm.commitMessage(queueMessage);
}
}catch (Exception queueException){
- LOG.error("Failed to commit message.",queueException);
+ logger.error("Failed to commit message.",queueException);
}
}
return message;
@@ -351,7 +349,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
providerAdapter.doneSendingNotifications();
}
catch ( Exception e ) {
- LOG.error( "providerAdapter.doneSendingNotifications: ", e );
+ logger.error( "providerAdapter.doneSendingNotifications: ", e );
}
}
//TODO: check if a notification is done and mark it
@@ -364,12 +362,12 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
taskManager.finishedBatch();
}
catch ( Exception e ) {
- LOG.error( "Failed to finish batch", e );
+ logger.error( "Failed to finish batch", e );
}
}
}
return notifications;
- } ).doOnError( throwable -> LOG.error( "Failed while sending", throwable ) );
+ } ).doOnError( throwable -> logger.error( "Failed while sending", throwable ) );
}, 10 );
return o;
@@ -381,7 +379,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
try {
adapter.stop();
}catch (Exception e){
- LOG.error("failed to stop adapter",e);
+ logger.error("failed to stop adapter",e);
}
}
}
@@ -438,7 +436,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
subscriber.onCompleted();
}
catch ( Throwable t ) {
- LOG.error("failed on subscriber",t);
+ logger.error("failed on subscriber",t);
subscriber.onError( t );
}
}
@@ -450,17 +448,17 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
for (final ProviderAdapter providerAdapter : providerAdapters) {
try {
if (providerAdapter != null) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("checking notifier {} for inactive devices", providerAdapter.getNotifier());
+ if (logger.isDebugEnabled()) {
+ logger.debug("checking notifier {} for inactive devices", providerAdapter.getNotifier());
}
providerAdapter.removeInactiveDevices();
- if (LOG.isDebugEnabled()) {
- LOG.debug("finished checking notifier {} for inactive devices", providerAdapter.getNotifier());
+ if (logger.isDebugEnabled()) {
+ logger.debug("finished checking notifier {} for inactive devices", providerAdapter.getNotifier());
}
}
} catch (Exception e) {
- LOG.error("checkForInactiveDevices", e); // not
+ logger.error("checkForInactiveDevices", e); // not
// essential so
// don't fail,
// but log
@@ -472,17 +470,17 @@ 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"))) {
- LOG.info("notification {} already processed. not sending.",
+ logger.info("notification {} already processed. not sending.",
notification.getUuid());
return false;
}
if (notification.getCanceled() == Boolean.TRUE) {
- LOG.info("notification {} canceled. not sending.",
+ logger.info("notification {} canceled. not sending.",
notification.getUuid());
return false;
}
if (notification.isExpired()) {
- LOG.info("notification {} expired. not sending.",
+ logger.info("notification {} expired. not sending.",
notification.getUuid());
return false;
}
@@ -515,7 +513,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager {
}
return value != null ? value.toString() : null;
} catch (Exception e) {
- LOG.error("Errer getting provider ID, proceding with rest of batch", e);
+ logger.error("Errer getting provider ID, proceding with rest of batch", e);
return null;
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
index f2946df..b256dec 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
@@ -36,7 +36,6 @@ import org.apache.usergrid.services.notifications.TaskTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -46,7 +45,7 @@ import java.util.Map;
*/
public class WNSAdapter implements ProviderAdapter {
- private static final Logger LOG = LoggerFactory.getLogger(WNSAdapter.class);
+ private static final Logger logger = LoggerFactory.getLogger(WNSAdapter.class);
private final EntityManager entityManager;
private final Notifier notifier;
@@ -65,7 +64,7 @@ public class WNSAdapter implements ProviderAdapter {
//this fails every time due to jax error which is ok
service.pushToast("s-1-15-2-2411381248-444863693-3819932088-4077691928-1194867744-112853457-373132695", toast);
}catch (ClientHandlerException e){
- LOG.info("Windows Phone notifier added: " + e.toString());
+ logger.info("Windows Phone notifier added: " + e.toString());
}
}
@@ -118,7 +117,7 @@ public class WNSAdapter implements ProviderAdapter {
tracker.completed();
} catch (Exception e) {
tracker.failed(0,e.toString());
- LOG.error("Failed to send notification",e);
+ logger.error("Failed to send notification",e);
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 5404e6b..b1c90d1 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
@@ -30,7 +30,6 @@ import org.apache.usergrid.services.ServiceManager;
import org.apache.usergrid.services.ServiceManagerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import rx.*;
import javax.annotation.PostConstruct;
import java.util.*;
@@ -48,7 +47,7 @@ public abstract class QueueListener {
public long DEFAULT_SLEEP = 5000;
- private static final Logger LOG = LoggerFactory.getLogger(QueueListener.class);
+ private static final Logger logger = LoggerFactory.getLogger(QueueListener.class);
private MetricsFactory metricsService;
@@ -104,7 +103,7 @@ public abstract class QueueListener {
boolean shouldRun = new Boolean(properties.getProperty("usergrid.queues.listener.run", "true"));
if(shouldRun) {
- LOG.info("QueueListener: starting.");
+ logger.info("QueueListener: starting.");
int threadCount = 0;
try {
@@ -123,25 +122,25 @@ public abstract class QueueListener {
pool = Executors.newFixedThreadPool(maxThreads);
while (threadCount++ < maxThreads) {
- LOG.info("QueueListener: Starting thread {}.", threadCount);
+ logger.info("QueueListener: Starting thread {}.", threadCount);
Runnable task = new Runnable() {
@Override
public void run() {
try {
execute();
} catch (Exception e) {
- LOG.error("failed to start push", e);
+ logger.error("failed to start push", e);
}
}
};
futures.add( pool.submit(task));
}
} catch (Exception e) {
- LOG.error("QueueListener: failed to start:", e);
+ logger.error("QueueListener: failed to start:", e);
}
- LOG.info("QueueListener: done starting.");
+ logger.info("QueueListener: done starting.");
}else{
- LOG.info("QueueListener: never started due to config value usergrid.queues.listener.run.");
+ logger.info("QueueListener: never started due to config value usergrid.queues.listener.run.");
}
}
@@ -158,9 +157,9 @@ public abstract class QueueListener {
Thread.currentThread().setName("queues_Processor"+UUID.randomUUID());
final AtomicInteger consecutiveExceptions = new AtomicInteger();
- LOG.info("QueueListener: Starting execute process.");
+ logger.info("QueueListener: Starting execute process.");
svcMgr = smf.getServiceManager(smf.getManagementAppId());
- LOG.info("getting from queue {} ", queueName);
+ logger.info("getting from queue {} ", queueName);
QueueScope queueScope = new QueueScopeImpl( queueName, QueueScope.RegionImplementation.LOCAL);
QueueManager queueManager = TEST_QUEUE_MANAGER != null ? TEST_QUEUE_MANAGER : queueManagerFactory.getQueueManager(queueScope);
// run until there are no more active jobs
@@ -177,7 +176,7 @@ public abstract class QueueListener {
.buffer(getBatchSize())
.doOnNext(messages -> {
try {
- LOG.info("retrieved batch of {} messages from queue {} ", messages.size(), queueName);
+ logger.info("retrieved batch of {} messages from queue {} ", messages.size(), queueName);
if (messages.size() > 0) {
@@ -190,30 +189,30 @@ public abstract class QueueListener {
queueManager.commitMessages(messages);
meter.mark(messages.size());
- LOG.info("sent batch {} messages duration {} ms", messages.size(), System.currentTimeMillis() - now);
+ logger.info("sent batch {} messages duration {} ms", messages.size(), System.currentTimeMillis() - now);
if (sleepBetweenRuns > 0) {
- LOG.info("sleep between rounds...sleep...{}", sleepBetweenRuns);
+ logger.info("sleep between rounds...sleep...{}", sleepBetweenRuns);
Thread.sleep(sleepBetweenRuns);
}
} else {
- LOG.info("no messages...sleep...{}", sleepWhenNoneFound);
+ logger.info("no messages...sleep...{}", sleepWhenNoneFound);
Thread.sleep(sleepWhenNoneFound);
}
timerContext.stop();
//send to the providers
consecutiveExceptions.set(0);
} catch (Exception ex) {
- LOG.error("failed to dequeue", ex);
+ logger.error("failed to dequeue", ex);
try {
long sleeptime = sleepWhenNoneFound * consecutiveExceptions.incrementAndGet();
long maxSleep = 15000;
sleeptime = sleeptime > maxSleep ? maxSleep : sleeptime;
- LOG.info("sleeping due to failures {} ms", sleeptime);
+ logger.info("sleeping due to failures {} ms", sleeptime);
Thread.sleep(sleeptime);
} catch (InterruptedException ie) {
- LOG.info("sleep interrupted");
+ logger.info("sleep interrupted");
}
}
}).toBlocking().lastOrDefault(null);
@@ -222,7 +221,7 @@ public abstract class QueueListener {
public void stop(){
- LOG.info("stop processes");
+ logger.info("stop processes");
if(futures == null){
return;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/services/src/test/java/org/apache/usergrid/NewOrgAppAdminRule.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/NewOrgAppAdminRule.java b/stack/services/src/test/java/org/apache/usergrid/NewOrgAppAdminRule.java
index 5771b67..659520e 100644
--- a/stack/services/src/test/java/org/apache/usergrid/NewOrgAppAdminRule.java
+++ b/stack/services/src/test/java/org/apache/usergrid/NewOrgAppAdminRule.java
@@ -41,7 +41,7 @@ import static org.apache.usergrid.TestHelper.newUUIDString;
*/
public class NewOrgAppAdminRule implements TestRule {
- private static final Logger LOG = LoggerFactory.getLogger( CoreApplication.class );
+ private static final Logger logger = LoggerFactory.getLogger( CoreApplication.class );
public static final String ADMIN_NAME = "Test Admin";
public static final String ADMIN_PASSWORD = "password";
@@ -76,7 +76,7 @@ public class NewOrgAppAdminRule implements TestRule {
protected void after( Description description ) {
- LOG.info( "Test {}: finish with application", description.getDisplayName() );
+ logger.info( "Test {}: finish with application", description.getDisplayName() );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/services/src/test/java/org/apache/usergrid/ServiceApplication.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/ServiceApplication.java b/stack/services/src/test/java/org/apache/usergrid/ServiceApplication.java
index 1ed10df..89ff272 100644
--- a/stack/services/src/test/java/org/apache/usergrid/ServiceApplication.java
+++ b/stack/services/src/test/java/org/apache/usergrid/ServiceApplication.java
@@ -22,8 +22,6 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
-import org.apache.usergrid.persistence.cache.CacheScope;
-import org.apache.usergrid.persistence.cache.ScopedCache;
import org.junit.runner.Description;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,7 +44,7 @@ import static org.apache.usergrid.utils.InflectionUtils.pluralize;
public class ServiceApplication extends CoreApplication {
- private static final Logger LOG = LoggerFactory.getLogger( ServiceApplication.class );
+ private static final Logger logger = LoggerFactory.getLogger( ServiceApplication.class );
protected ServiceManager sm;
protected ServiceITSetup svcSetup;
@@ -100,7 +98,7 @@ public class ServiceApplication extends CoreApplication {
public ServiceResults invokeService( ServiceAction action, Object... params ) throws Exception {
ServiceRequest request = sm.newRequest( action, parameters( params ), payload( properties ) );
- LOG.info( "Request: {} {}", action, request.toString() );
+ logger.info( "Request: {} {}", action, request.toString() );
dumpProperties( properties );
ServiceResults results = request.execute();
assertNotNull( results );
@@ -115,8 +113,8 @@ public class ServiceApplication extends CoreApplication {
public void dumpProperties( Map<String, Object> properties ) {
- if ( properties != null && LOG.isInfoEnabled() ) {
- LOG.info( "Input:\n {}", JsonUtils.mapToFormattedJsonString( properties ) );
+ if ( properties != null && logger.isInfoEnabled() ) {
+ logger.info( "Input:\n {}", JsonUtils.mapToFormattedJsonString( properties ) );
}
}
@@ -147,7 +145,7 @@ public class ServiceApplication extends CoreApplication {
public ServiceResults testBatchRequest( ServiceAction action, int expectedCount, List<Map<String, Object>> batch,
Object... params ) throws Exception {
ServiceRequest request = sm.newRequest( action, parameters( params ), batchPayload( batch ) );
- LOG.info( "Request: " + action + " " + request.toString() );
+ logger.info( "Request: " + action + " " + request.toString() );
// dump( "Batch", batch );
ServiceResults results = request.execute();
assertNotNull( results );
@@ -164,7 +162,7 @@ public class ServiceApplication extends CoreApplication {
public ServiceResults testDataRequest( ServiceAction action, Object... params ) throws Exception {
ServiceRequest request = sm.newRequest( action, parameters( params ), payload( properties ) );
- LOG.info( "Request: {} {}", action, request.toString() );
+ logger.info( "Request: {} {}", action, request.toString() );
dumpProperties( properties );
ServiceResults results = request.execute();
assertNotNull( results );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java b/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java
index 3d14c2f..599a796 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/EmailFlowIT.java
@@ -57,7 +57,7 @@ import static org.junit.Assert.*;
*/
@NotThreadSafe
public class EmailFlowIT {
- private static final Logger LOG = LoggerFactory.getLogger( EmailFlowIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( EmailFlowIT.class );
@Rule
public org.apache.usergrid.Application app = new CoreApplication( setup );
@@ -101,7 +101,7 @@ public class EmailFlowIT {
assertEquals( "User Account Confirmation: " + email, confirmation.getSubject() );
String token = getTokenFromMessage( confirmation );
- LOG.info( token );
+ logger.info( token );
assertEquals( ActivationState.ACTIVATED,
setup.getMgmtSvc().handleConfirmationTokenForAdminUser( org_owner.owner.getUuid(), token ) );
@@ -141,7 +141,7 @@ public class EmailFlowIT {
assertEquals( "User Account Confirmation: "+email, confirmation.getSubject() );
String token = getTokenFromMessage( confirmation );
- LOG.info( token );
+ logger.info( token );
ActivationState state =
setup.getMgmtSvc().handleConfirmationTokenForAdminUser( org_owner.owner.getUuid(), token );
@@ -162,7 +162,7 @@ public class EmailFlowIT {
assertEquals( "Request For Admin User Account Activation "+email, activation.getSubject() );
token = getTokenFromMessage( activation );
- LOG.info( token );
+ logger.info( token );
state = setup.getMgmtSvc().handleActivationTokenForAdminUser( org_owner.owner.getUuid(), token );
assertEquals( ActivationState.ACTIVATED, state );
@@ -266,12 +266,12 @@ public class EmailFlowIT {
// activation url ok
String mailContent = ( String ) ( ( MimeMultipart ) activation.getContent() ).getBodyPart( 1 ).getContent();
- LOG.info( mailContent );
+ logger.info( mailContent );
assertTrue( StringUtils.contains( mailContent.toLowerCase(), activation_url.toLowerCase() ) );
// token ok
String token = getTokenFromMessage( activation );
- LOG.info( token );
+ logger.info( token );
ActivationState activeState =
setup.getMgmtSvc().handleActivationTokenForAppUser( app.getId(), appUser.getUuid(), token );
assertEquals( ActivationState.ACTIVATED, activeState );
@@ -294,12 +294,12 @@ public class EmailFlowIT {
// resetpwd url ok
mailContent = ( String ) ( ( MimeMultipart ) reset.getContent() ).getBodyPart( 1 ).getContent();
- LOG.info( mailContent );
+ logger.info( mailContent );
assertTrue( StringUtils.contains( mailContent.toLowerCase(), reset_url.toLowerCase() ) );
// token ok
token = getTokenFromMessage( reset );
- LOG.info( token );
+ logger.info( token );
assertTrue( setup.getMgmtSvc().checkPasswordResetTokenForAppUser( app.getId(), appUser.getUuid(), token ) );
// ensure revoke works
@@ -356,12 +356,12 @@ public class EmailFlowIT {
// confirmation url ok
String mailContent = ( String ) ( ( MimeMultipart ) confirmation.getContent() ).getBodyPart( 1 ).getContent();
- LOG.info( mailContent );
+ logger.info( mailContent );
assertTrue( StringUtils.contains( mailContent.toLowerCase(), confirmation_url.toLowerCase() ) );
// token ok
String token = getTokenFromMessage( confirmation );
- LOG.info( token );
+ logger.info( token );
ActivationState activeState =
setup.getMgmtSvc().handleConfirmationTokenForAppUser( app.getId(), user.getUuid(), token );
assertEquals( ActivationState.CONFIRMED_AWAITING_ACTIVATION, activeState );
@@ -393,7 +393,7 @@ public class EmailFlowIT {
private void testProperty( String propertyName, boolean containsSubstitution ) {
String propertyValue = setup.get( propertyName );
assertTrue( propertyName + " was not found", isNotBlank( propertyValue ) );
- LOG.info( propertyName + "=" + propertyValue );
+ logger.info( propertyName + "=" + propertyValue );
if ( containsSubstitution ) {
Map<String, String> valuesMap = new HashMap<String, String>();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/services/src/test/java/org/apache/usergrid/management/RoleIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/RoleIT.java b/stack/services/src/test/java/org/apache/usergrid/management/RoleIT.java
index 0bd4f41..075ee03 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/RoleIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/RoleIT.java
@@ -31,12 +31,10 @@ import org.apache.shiro.subject.Subject;
import org.apache.usergrid.ServiceITSetup;
import org.apache.usergrid.ServiceITSetupImpl;
-import org.apache.usergrid.cassandra.SpringResource;
import org.apache.usergrid.cassandra.ClearShiroSubject;
import org.apache.usergrid.persistence.EntityManager;
import org.apache.usergrid.persistence.entities.User;
-import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
import org.apache.usergrid.security.shiro.PrincipalCredentialsToken;
import org.apache.usergrid.security.shiro.utils.SubjectUtils;
@@ -45,7 +43,7 @@ import static org.junit.Assert.assertFalse;
public class RoleIT {
- private static final Logger LOG = LoggerFactory.getLogger( RoleIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( RoleIT.class );
@Rule
public ClearShiroSubject clearShiroSubject = new ClearShiroSubject();
@@ -89,7 +87,7 @@ public class RoleIT {
subject.checkRole( "application-role:" + applicationId + ":logged-in" );
- LOG.info( "Has role \"logged-in\"" );
+ logger.info( "Has role \"logged-in\"" );
Thread.sleep( 2100 );
@@ -97,6 +95,6 @@ public class RoleIT {
assertFalse( subject.hasRole( "application-role:" + applicationId + ":logged-in" ) );
- LOG.info( "Doesn't have role \"logged-in\"" );
+ logger.info( "Doesn't have role \"logged-in\"" );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
index ad2ce66..270a6cb 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/cassandra/ManagementServiceIT.java
@@ -58,7 +58,7 @@ import static org.junit.Assert.*;
*/
public class ManagementServiceIT {
- private static final Logger LOG = LoggerFactory.getLogger( ManagementServiceIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( ManagementServiceIT.class );
@ClassRule
@@ -79,7 +79,7 @@ public class ManagementServiceIT {
@Before
public void setup() throws Exception {
- LOG.info( "in setup" );
+ logger.info( "in setup" );
adminUser = orgAppAdminRule.getAdminInfo();
@@ -140,8 +140,8 @@ public class ManagementServiceIT {
EntityManager em = setup.getEmf().getEntityManager( setup.getEmf().getManagementAppId() );
Map<String, Long> counts = em.getApplicationCounters();
- LOG.info( JsonUtils.mapToJsonString( counts ) );
- LOG.info( JsonUtils.mapToJsonString( em.getCounterNames() ) );
+ logger.info( JsonUtils.mapToJsonString( counts ) );
+ logger.info( JsonUtils.mapToJsonString( em.getCounterNames() ) );
final Long existingCounts = counts.get( "admin_logins" );
@@ -152,8 +152,8 @@ public class ManagementServiceIT {
counts = em.getApplicationCounters();
- LOG.info( JsonUtils.mapToJsonString( counts ) );
- LOG.info( JsonUtils.mapToJsonString( em.getCounterNames() ) );
+ logger.info( JsonUtils.mapToJsonString( counts ) );
+ logger.info( JsonUtils.mapToJsonString( em.getCounterNames() ) );
assertNotNull( counts.get( "admin_logins" ) );
final long newCount = counts.get( "admin_logins" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/services/src/test/java/org/apache/usergrid/security/tokens/TokenServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/security/tokens/TokenServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/security/tokens/TokenServiceIT.java
index b5471ec..c4cc10c 100644
--- a/stack/services/src/test/java/org/apache/usergrid/security/tokens/TokenServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/security/tokens/TokenServiceIT.java
@@ -52,7 +52,7 @@ import static org.junit.Assert.assertTrue;
public class TokenServiceIT {
- private static final Logger log = LoggerFactory.getLogger( TokenServiceIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( TokenServiceIT.class );
// app-level data generated only once per test
private UserInfo adminUser;
@@ -68,7 +68,7 @@ public class TokenServiceIT {
@Before
public void setup() throws Exception {
- log.info( "in setup" );
+ logger.info( "in setup" );
adminUser = newOrgAppAdminRule.getAdminInfo();
}
@@ -87,7 +87,7 @@ public class TokenServiceIT {
String tokenStr = setup.getTokenSvc().createToken( TokenCategory.EMAIL, "email_confirm", null, data, 0 );
- log.info( "token: " + tokenStr );
+ logger.info( "token: " + tokenStr );
TokenInfo tokenInfo = setup.getTokenSvc().getTokenInfo( tokenStr );
@@ -111,7 +111,7 @@ public class TokenServiceIT {
String tokenStr = setup.getTokenSvc().createToken( TokenCategory.ACCESS, null, adminPrincipal, null, 0 );
- log.info( "token: " + tokenStr );
+ logger.info( "token: " + tokenStr );
TokenInfo tokenInfo = setup.getTokenSvc().getTokenInfo( tokenStr );
@@ -451,7 +451,7 @@ public class TokenServiceIT {
String tokenStr = setup.getTokenSvc().createToken(
TokenCategory.ACCESS, null, adminPrincipal, null, 0 );
- log.info("token: " + tokenStr);
+ logger.info("token: " + tokenStr);
// revoke token and check to make sure it is no longer valid
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java b/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java
index ceaf996..57f0bb2 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/ServiceInvocationIT.java
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
public class ServiceInvocationIT extends AbstractServiceIT {
- private static final Logger LOG = LoggerFactory.getLogger( ServiceInvocationIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( ServiceInvocationIT.class );
@Rule
public ClearShiroSubject clearShiroSubject = new ClearShiroSubject();
@@ -44,7 +44,7 @@ public class ServiceInvocationIT extends AbstractServiceIT {
@Test
public void testServices() throws Exception {
- LOG.info( "testServices" );
+ logger.info( "testServices" );
app.put( "username", "edanuff" );
app.put( "email", "ed@anuff.com" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/test-utils/src/main/java/org/apache/usergrid/TomcatMain.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/TomcatMain.java b/stack/test-utils/src/main/java/org/apache/usergrid/TomcatMain.java
index d575bc7..c964b32 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/TomcatMain.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/TomcatMain.java
@@ -26,8 +26,8 @@ import org.slf4j.LoggerFactory;
* Simple wrapper for starting "embedded" Tomcat as it's own process, for testing.
*/
public class TomcatMain {
-
- private static final Logger log = LoggerFactory.getLogger( TomcatMain.class );
+
+ private static final Logger logger = LoggerFactory.getLogger( TomcatMain.class );
public static void main(String[] args) throws Exception {
@@ -43,9 +43,9 @@ public class TomcatMain {
tomcat.getConnector().setAttribute("maxThreads", "1000");
tomcat.addWebapp("/", new File(webappsPath).getAbsolutePath());
- log.info("-----------------------------------------------------------------");
- log.info("Starting Tomcat port {} dir {}", port, webappsPath);
- log.info("-----------------------------------------------------------------");
+ logger.info("-----------------------------------------------------------------");
+ logger.info("Starting Tomcat port {} dir {}", port, webappsPath);
+ logger.info("-----------------------------------------------------------------");
tomcat.start();
while ( true ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/AvailablePortFinder.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/AvailablePortFinder.java b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/AvailablePortFinder.java
index c392146..1d7ee21 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/AvailablePortFinder.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/AvailablePortFinder.java
@@ -37,8 +37,8 @@ import org.slf4j.LoggerFactory;
* @see <a href="http://www.iana.org/assignments/port-numbers">IANA.org</a>
*/
public class AvailablePortFinder {
-
- private static final Logger LOG = LoggerFactory.getLogger( AvailablePortFinder.class );
+
+ private static final Logger logger = LoggerFactory.getLogger( AvailablePortFinder.class );
/** The minimum number of server port number. */
public static final int MIN_PORT_NUMBER = 1;
@@ -126,24 +126,24 @@ public class AvailablePortFinder {
// Jackson: It seems like the code below intends to
// setReuseAddress(true), but that needs to be set before the bind.
// The constructor for the ServerSocket(int) will bind, so not sure
- // how it would have been working as intended previously.
-
+ // how it would have been working as intended previously.
+
// Changing ServerSocket constructor to use default constructor,
// this would be unbound, then set the socket reuse, and
// call the bind separately
-
+
//ss = new ServerSocket( port );
ss = new ServerSocket();
ss.setReuseAddress( true );
ss.bind(new InetSocketAddress((InetAddress) null, port), 0);
-
+
// Unlike ServerSocket, the default constructor of DatagramSocket
- // will bound. To create an unbound DatagramSocket, use null address
+ // will bound. To create an unbound DatagramSocket, use null address
//ds = new DatagramSocket( port );
ds = new DatagramSocket(null);
ds.setReuseAddress( true );
ds.bind(new InetSocketAddress((InetAddress) null, port));
- LOG.info("port {} available", port);
+ logger.info("port {} available", port);
return true;
}
catch ( IOException e ) {
@@ -163,7 +163,7 @@ public class AvailablePortFinder {
}
}
}
- LOG.info("port {} unavailable", port);
+ logger.info("port {} unavailable", port);
return false;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 99ae2c5..a87af41 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
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
public class CassandraResource extends EnvironResource {
- public static final Logger LOG = LoggerFactory.getLogger( SpringResource.class );
+ public static final Logger logger = LoggerFactory.getLogger( SpringResource.class );
public static final String DEFAULT_HOST = "127.0.0.1";
@@ -88,7 +88,7 @@ public class CassandraResource extends EnvironResource {
props.load( ClassLoader.getSystemResourceAsStream( "project.properties" ) );
}
catch ( IOException e ) {
- LOG.error( "Unable to load project properties: {}", e.getLocalizedMessage() );
+ logger.error( "Unable to load project properties: {}", e.getLocalizedMessage() );
}
port = Integer.parseInt(
props.getProperty( "cassandra.rpcPort", Integer.toString( DEFAULT_RPC_PORT ) ) );
@@ -108,7 +108,7 @@ public class CassandraResource extends EnvironResource {
System.setProperty( "cassandra." + RPC_PORT_KEY, Integer.toString( port ) );
- LOG.info( "project.properties loaded properties for ports : " + "[rpc] = [{}]", new Object[] { port } );
+ logger.info( "project.properties loaded properties for ports : " + "[rpc] = [{}]", new Object[] { port } );
initialized = true;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java
index 4010b04..e46cc0c 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/ClearShiroSubject.java
@@ -22,15 +22,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.mgt.*;
-import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.subject.support.SubjectThreadState;
/** A {@link org.junit.rules.TestRule} that cleans up the Shiro Subject's ThreadState. */
public class ClearShiroSubject extends ExternalResource {
- private static final Logger LOG = LoggerFactory.getLogger( ClearShiroSubject.class );
+ private static final Logger logger = LoggerFactory.getLogger( ClearShiroSubject.class );
@@ -51,12 +49,12 @@ public class ClearShiroSubject extends ExternalResource {
if ( subject == null ) {
- LOG.info( "Shiro Subject was null. No need to clear manually." );
+ logger.info( "Shiro Subject was null. No need to clear manually." );
return;
}
new SubjectThreadState( subject ).clear();
- LOG.info( "Shiro Subject was NOT null. Subject has been cleared manually." );
+ logger.info( "Shiro Subject was NOT null. Subject has been cleared manually." );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/SpringResource.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/SpringResource.java b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/SpringResource.java
index 7d3782d..01e9e6b 100644
--- a/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/SpringResource.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/cassandra/SpringResource.java
@@ -31,7 +31,7 @@ import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
* spring context within this singleton
*/
public class SpringResource {
- public static final Logger LOG = LoggerFactory.getLogger( SpringResource.class );
+ public static final Logger logger = LoggerFactory.getLogger( SpringResource.class );
private static SpringResource instance;
@@ -44,12 +44,12 @@ public class SpringResource {
* Cassandra.
*/
private SpringResource() {
- LOG.info( "Creating CassandraResource using {} for the ClassLoader.",
+ logger.info( "Creating CassandraResource using {} for the ClassLoader.",
Thread.currentThread().getContextClassLoader() );
- LOG.info( "-------------------------------------------------------------------" );
- LOG.info( "Initializing Spring" );
- LOG.info( "-------------------------------------------------------------------" );
+ logger.info( "-------------------------------------------------------------------" );
+ logger.info( "Initializing Spring" );
+ logger.info( "-------------------------------------------------------------------" );
//wire up cassandra and elasticsearch before we start spring, otherwise this won't work
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/test-utils/src/test/java/org/apache/usergrid/cassandra/SpringResourceTest.java
----------------------------------------------------------------------
diff --git a/stack/test-utils/src/test/java/org/apache/usergrid/cassandra/SpringResourceTest.java b/stack/test-utils/src/test/java/org/apache/usergrid/cassandra/SpringResourceTest.java
index 140e318..52d1483 100644
--- a/stack/test-utils/src/test/java/org/apache/usergrid/cassandra/SpringResourceTest.java
+++ b/stack/test-utils/src/test/java/org/apache/usergrid/cassandra/SpringResourceTest.java
@@ -27,7 +27,7 @@ import static junit.framework.TestCase.assertSame;
/** This tests the CassandraResource. */
public class SpringResourceTest {
- public static final Logger LOG = LoggerFactory.getLogger( SpringResourceTest.class );
+ public static final Logger logger = LoggerFactory.getLogger( SpringResourceTest.class );
@@ -40,18 +40,18 @@ public class SpringResourceTest {
@Test
public void testDoubleTrouble() throws Throwable {
SpringResource c1 = SpringResource.getInstance();
- LOG.info( "Starting up first Spring instance: {}", c1 );
+ logger.info( "Starting up first Spring instance: {}", c1 );
- LOG.debug( "Waiting for the new instance to come online." );
+ logger.debug( "Waiting for the new instance to come online." );
SchemaManager c1SchemaManager = c1.getBean( SchemaManager.class );
SpringResource c2 = SpringResource.getInstance();
- LOG.debug( "Starting up second Spring instance: {}", c2 );
+ logger.debug( "Starting up second Spring instance: {}", c2 );
SchemaManager c2SchemaManager = c2.getBean( SchemaManager.class );
- LOG.debug( "Waiting a few seconds for second instance to be ready before shutting down." );
+ logger.debug( "Waiting a few seconds for second instance to be ready before shutting down." );
assertSame("Instances should be from the same spring context", c1SchemaManager, c2SchemaManager);
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseExport.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseExport.java b/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseExport.java
index 564bd7e..48d47be 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseExport.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseExport.java
@@ -63,7 +63,7 @@ import static org.apache.usergrid.persistence.Schema.getDefaultSchema;
*/
public class WarehouseExport extends ExportingToolBase {
- private static final Logger LOG = LoggerFactory.getLogger( WarehouseExport.class );
+ private static final Logger logger = LoggerFactory.getLogger( WarehouseExport.class );
private static final char SEPARATOR = '|';
public static final String BUCKET_PROPNAME = "usergrid.warehouse-export-bucket";
@@ -115,14 +115,14 @@ public class WarehouseExport extends ExportingToolBase {
applyOrgId( line );
prepareBaseOutputFileName( line );
outputDir = createOutputParentDir();
- LOG.info( "Export directory: {}", outputDir.getAbsolutePath() );
+ logger.info( "Export directory: {}", outputDir.getAbsolutePath() );
// create writer
applyStartTime( line );
applyEndTime( line );
- LOG.error( "startTime: {}, endTime: {}", startTime, endTime );
+ logger.error( "startTime: {}, endTime: {}", startTime, endTime );
if ( startTime.getTime() >= endTime.getTime() ) {
- LOG.error( "startTime must be before endTime. exiting." );
+ logger.error( "startTime must be before endTime. exiting." );
System.exit( 1 );
}
@@ -154,7 +154,7 @@ public class WarehouseExport extends ExportingToolBase {
// now that file is written, copy it to S3
if ( line.hasOption( "upload" ) ) {
- LOG.info( "Copy to S3" );
+ logger.info( "Copy to S3" );
copyToS3( fileName );
}
}
@@ -183,7 +183,7 @@ public class WarehouseExport extends ExportingToolBase {
s3Client.createBucket( bucketName );
File uploadFile = new File( fileName );
PutObjectResult putObjectResult = s3Client.putObject( bucketName, uploadFile.getName(), uploadFile );
- LOG.info("Uploaded file etag={}", putObjectResult.getETag());
+ logger.info("Uploaded file etag={}", putObjectResult.getETag());
}
@@ -341,7 +341,7 @@ public class WarehouseExport extends ExportingToolBase {
OrganizationInfo info = managementService.getOrganizationByUuid( orgId );
if ( info == null ) {
- LOG.error( "Organization info is null!" );
+ logger.error( "Organization info is null!" );
System.exit( 1 );
}
@@ -377,7 +377,7 @@ public class WarehouseExport extends ExportingToolBase {
private void exportApplicationsForOrg( Entry<UUID, String> orgIdAndName, String queryString ) throws Exception {
- LOG.info( "organization: {} / {}", orgIdAndName.getValue(), orgIdAndName.getKey() );
+ logger.info( "organization: {} / {}", orgIdAndName.getValue(), orgIdAndName.getKey() );
String orgName = orgIdAndName.getValue();
@@ -387,7 +387,7 @@ public class WarehouseExport extends ExportingToolBase {
String appName = appIdAndName.getValue();
appName = appName.substring( appName.indexOf( '/' ) + 1 );
- LOG.info( "application {} / {}", appName, appIdAndName.getKey() );
+ logger.info( "application {} / {}", appName, appIdAndName.getKey() );
EntityManager em = emf.getEntityManager( appIdAndName.getKey() );
Map<String, String[]> cfm = getCollectionFieldMap();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseUpsert.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseUpsert.java b/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseUpsert.java
index 158abd6..901fb7e 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseUpsert.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/WarehouseUpsert.java
@@ -31,7 +31,7 @@ import org.apache.commons.io.IOUtils;
/** Upserts data from files found in an S3 bucket. */
public class WarehouseUpsert extends ExportingToolBase {
- private static final Logger LOG = LoggerFactory.getLogger( WarehouseUpsert.class );
+ private static final Logger logger = LoggerFactory.getLogger( WarehouseUpsert.class );
public static final String DBHOST_PROPNAME = "usergrid.warehouse-export-dbhost";
public static final String DBPORT_PROPNAME = "usergrid.warehouse-export-dbport";
@@ -84,14 +84,14 @@ public class WarehouseUpsert extends ExportingToolBase {
String mainTableName = ( String ) properties.get( MAIN_TABLE_PROPNAME );
try {
con.createStatement().execute( createWarehouseTable( mainTableName ) );
- LOG.info( "Created main table " + mainTableName );
+ logger.info( "Created main table " + mainTableName );
}
catch ( SQLException ex ) {
if ( !ex.getMessage().contains( "already exists" ) ) {
- LOG.error( "Error creating main table: " + ex.getMessage(), ex );
+ logger.error( "Error creating main table: " + ex.getMessage(), ex );
}
else {
- LOG.info( "Using existing main table " + mainTableName );
+ logger.info( "Using existing main table " + mainTableName );
}
}
@@ -100,47 +100,47 @@ public class WarehouseUpsert extends ExportingToolBase {
String dropStagingTable = String.format( "drop table %s", stagingTableName );
try {
con.createStatement().execute( dropStagingTable );
- LOG.info( "Dropped existing staging table " + stagingTableName );
+ logger.info( "Dropped existing staging table " + stagingTableName );
}
catch ( SQLException ex ) {
if ( !ex.getMessage().contains( "does not exist" ) ) {
- LOG.error( "Error dropping staging table: " + ex.getMessage(), ex );
+ logger.error( "Error dropping staging table: " + ex.getMessage(), ex );
}
else {
- LOG.info( "Using existing staging table " + stagingTableName );
+ logger.info( "Using existing staging table " + stagingTableName );
}
}
// create staging table
- LOG.info( "Creating new staging table" );
+ logger.info( "Creating new staging table" );
con.createStatement().execute( createWarehouseTable( stagingTableName ) );
// copy data from S3 into staging table
- LOG.info( "Copying data from S3" );
+ logger.info( "Copying data from S3" );
String copyFromS3 = String.format( "COPY %s FROM 's3://%s' "
+ "CREDENTIALS 'aws_access_key_id=%s;aws_secret_access_key=%s' IGNOREHEADER 2 EMPTYASNULL",
stagingTableName, bucketName, accessId, secretKey );
- LOG.debug( copyFromS3 );
+ logger.debug( copyFromS3 );
con.createStatement().execute( copyFromS3 );
// run update portion of upsert process
- LOG.info( "Upsert: updating" );
+ logger.info( "Upsert: updating" );
String upsertUpdate =
String.format( "UPDATE %s SET id = s.id FROM %s s WHERE %s.created = s.created ", mainTableName,
stagingTableName, mainTableName );
- LOG.debug( upsertUpdate );
+ logger.debug( upsertUpdate );
con.createStatement().execute( upsertUpdate );
// insert new values in staging table into main table
- LOG.info( "Upsert: inserting" );
+ logger.info( "Upsert: inserting" );
String upsertInsert =
String.format( "INSERT INTO %s SELECT s.* FROM %s s LEFT JOIN %s n ON s.id = n.id WHERE n.id IS NULL",
mainTableName, stagingTableName, mainTableName );
- LOG.debug( upsertInsert );
+ logger.debug( upsertInsert );
con.createStatement().execute( upsertInsert );
// drop staging table
- LOG.info( "Dropping existing staging table" );
+ logger.info( "Dropping existing staging table" );
con.createStatement().execute( dropStagingTable );
// done!
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/websocket/src/main/java/org/apache/usergrid/websocket/WebSocketChannelHandler.java
----------------------------------------------------------------------
diff --git a/stack/websocket/src/main/java/org/apache/usergrid/websocket/WebSocketChannelHandler.java b/stack/websocket/src/main/java/org/apache/usergrid/websocket/WebSocketChannelHandler.java
index 63d76a4..91ca42f 100644
--- a/stack/websocket/src/main/java/org/apache/usergrid/websocket/WebSocketChannelHandler.java
+++ b/stack/websocket/src/main/java/org/apache/usergrid/websocket/WebSocketChannelHandler.java
@@ -81,7 +81,7 @@ import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1;
public class WebSocketChannelHandler extends SimpleChannelUpstreamHandler {
- private static final Logger LOG = LoggerFactory.getLogger( WebSocketChannelHandler.class );
+ private static final Logger logger = LoggerFactory.getLogger( WebSocketChannelHandler.class );
private final EntityManagerFactory emf;
private final ServiceManagerFactory smf;
@@ -144,7 +144,7 @@ public class WebSocketChannelHandler extends SimpleChannelUpstreamHandler {
}
String location =
( ssl ? "wss://" : "ws://" ) + req.getHeader( HttpHeaders.Names.HOST ) + ( path != null ? path : "" );
- LOG.info( location );
+ logger.info( location );
return location;
}
@@ -171,7 +171,7 @@ public class WebSocketChannelHandler extends SimpleChannelUpstreamHandler {
@Override
public void exceptionCaught( ChannelHandlerContext ctx, ExceptionEvent e ) {
- LOG.warn( "Unexpected exception from downstream.", e.getCause() );
+ logger.warn( "Unexpected exception from downstream.", e.getCause() );
e.getChannel().close();
}
@@ -180,7 +180,7 @@ public class WebSocketChannelHandler extends SimpleChannelUpstreamHandler {
public void channelDisconnected( ChannelHandlerContext ctx, ChannelStateEvent e ) throws Exception {
super.channelDisconnected( ctx, e );
if ( websocket ) {
- LOG.info( "Websocket disconnected" );
+ logger.info( "Websocket disconnected" );
}
}
@@ -224,7 +224,7 @@ public class WebSocketChannelHandler extends SimpleChannelUpstreamHandler {
else if ( is_ws_request ) {
// Serve the WebSocket handshake request.
- LOG.info( "Starting new websocket connection..." );
+ logger.info( "Starting new websocket connection..." );
websocket = true;
// Create the WebSocket handshake response.
@@ -235,7 +235,7 @@ public class WebSocketChannelHandler extends SimpleChannelUpstreamHandler {
QueryStringDecoder qs = new QueryStringDecoder( req.getUri() );
String path = qs.getPath();
- LOG.info( path );
+ logger.info( path );
// Fill in the headers and contents depending on handshake method.
if ( req.containsHeader( SEC_WEBSOCKET_KEY1 ) && req.containsHeader( SEC_WEBSOCKET_KEY2 ) ) {
@@ -243,7 +243,7 @@ public class WebSocketChannelHandler extends SimpleChannelUpstreamHandler {
String[] segments = split( path, '/' );
if ( segments.length != 3 ) {
- LOG.info( "Wrong number of path segments, expected 3, found " + segments.length );
+ logger.info( "Wrong number of path segments, expected 3, found " + segments.length );
sendHttpResponse( ctx, req, FORBIDDEN );
return;
}
@@ -252,7 +252,7 @@ public class WebSocketChannelHandler extends SimpleChannelUpstreamHandler {
String collStr = segments[1];
String idStr = segments[2];
- LOG.info( nsStr + "/" + collStr + "/" + idStr );
+ logger.info( nsStr + "/" + collStr + "/" + idStr );
if ( isEmpty( nsStr ) || isEmpty( collStr ) || isEmpty( idStr ) ) {
sendHttpResponse( ctx, req, FORBIDDEN );
[2/7] usergrid git commit: changed LOG and log to logger for
standardizing logging
Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 e663d5a..f398fa2 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
@@ -40,7 +40,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.usergrid.persistence.core.consistency.TimeService;
-import org.apache.usergrid.persistence.core.executor.TaskExecutorFactory;
import org.apache.usergrid.persistence.core.scope.ApplicationScope;
import org.apache.usergrid.persistence.graph.GraphFig;
import org.apache.usergrid.persistence.graph.MarkedEdge;
@@ -66,7 +65,6 @@ import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.netflix.astyanax.Keyspace;
@@ -82,7 +80,7 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
private final AtomicLong countAudits;
- private static final Logger LOG = LoggerFactory.getLogger( ShardGroupCompactionImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( ShardGroupCompactionImpl.class );
private static final Charset CHARSET = Charset.forName( "UTF-8" );
@@ -149,8 +147,8 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
Preconditions
.checkArgument( group.shouldCompact( startTime ), "Compaction cannot be run yet. Ignoring compaction." );
- if(LOG.isDebugEnabled()) {
- LOG.debug("Compacting shard group. Audit count is {} ", countAudits.get());
+ if(logger.isDebugEnabled()) {
+ logger.debug("Compacting shard group. Audit count is {} ", countAudits.get());
}
final CompactionResult.CompactionBuilder resultBuilder = CompactionResult.builder();
@@ -215,7 +213,7 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
deleteRowBatch.execute();
}
catch ( Throwable t ) {
- LOG.error( "Unable to move edges from shard {} to shard {}", sourceShard, targetShard );
+ logger.error( "Unable to move edges from shard {} to shard {}", sourceShard, targetShard );
}
}
}
@@ -227,11 +225,11 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
deleteRowBatch.execute();
}
catch ( Throwable t ) {
- LOG.error( "Unable to move edges to target shard {}", targetShard );
+ logger.error( "Unable to move edges to target shard {}", targetShard );
}
- LOG.info( "Finished compacting {} shards and moved {} edges", sourceShards, edgeCount );
+ logger.info( "Finished compacting {} shards and moved {} edges", sourceShards, edgeCount );
resultBuilder.withCopiedEdges( edgeCount ).withSourceShards( sourceShards ).withTargetShard( targetShard );
@@ -255,7 +253,7 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
continue;
}
- LOG.info( "Source shards have been fully drained. Removing shard {}", source );
+ logger.info( "Source shards have been fully drained. Removing shard {}", source );
final MutationBatch shardRemoval = edgeShardSerialization.removeShardMeta( scope, source, edgeMeta );
shardRemovalRollup.mergeShallow( shardRemoval );
@@ -272,7 +270,7 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
}
- LOG.info( "Shard has been fully compacted. Marking shard {} as compacted in Cassandra", targetShard );
+ logger.info( "Shard has been fully compacted. Marking shard {} as compacted in Cassandra", targetShard );
//Overwrite our shard index with a newly created one that has been marked as compacted
Shard compactedShard = new Shard( targetShard.getShardIndex(), timeService.getCurrentTime(), true );
@@ -306,8 +304,8 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
countAudits.getAndIncrement();
- if(LOG.isDebugEnabled()) {
- LOG.debug("Auditing shard group {}. count is {} ", group, countAudits.get());
+ if(logger.isDebugEnabled()) {
+ logger.debug("Auditing shard group {}. count is {} ", group, countAudits.get());
}
/**
@@ -322,7 +320,7 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
catch ( RejectedExecutionException ree ) {
//ignore, if this happens we don't care, we're saturated, we can check later
- LOG.error( "Rejected audit for shard of scope {} edge, meta {} and group {}", scope, edgeMeta, group );
+ logger.error( "Rejected audit for shard of scope {} edge, meta {} and group {}", scope, edgeMeta, group );
return Futures.immediateFuture( AuditResult.NOT_CHECKED );
}
@@ -333,13 +331,13 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
Futures.addCallback( future, new FutureCallback<AuditResult>() {
@Override
public void onSuccess( @Nullable final AuditResult result ) {
- LOG.debug( "Successfully completed audit of task {}", result );
+ logger.debug( "Successfully completed audit of task {}", result );
}
@Override
public void onFailure( final Throwable t ) {
- LOG.error( "Unable to perform audit. Exception is ", t );
+ logger.error( "Unable to perform audit. Exception is ", t );
}
} );
@@ -414,7 +412,7 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
*/
try {
CompactionResult result = compact( scope, edgeMeta, group );
- LOG.info( "Compaction result for compaction of scope {} with edge meta data of {} and shard group "
+ logger.info( "Compaction result for compaction of scope {} with edge meta data of {} and shard group "
+ "{} is {}", new Object[] { scope, edgeMeta, group, result } );
}
finally {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java
index a0be6a6..864397e 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java
@@ -31,7 +31,6 @@ import java.util.concurrent.Future;
import org.apache.usergrid.StressTest;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -67,7 +66,7 @@ import static org.junit.Assert.fail;
@UseModules( TestGraphModule.class )
@Category(StressTest.class)
public class GraphManagerLoadTest {
- private static final Logger log = LoggerFactory.getLogger( GraphManagerLoadTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( GraphManagerLoadTest.class );
@Inject
private GraphManagerFactory factory;
@@ -208,12 +207,12 @@ public class GraphManagerLoadTest {
if ( i % 1000 == 0 ) {
- log.info( " Wrote: " + i );
+ logger.info( " Wrote: " + i );
}
}
timer.stop();
- log.info( "Total time to write {} entries {} ms", writeLimit, timer.getTime() );
+ logger.info( "Total time to write {} entries {} ms", writeLimit, timer.getTime() );
timer.reset();
timer.start();
@@ -237,7 +236,7 @@ public class GraphManagerLoadTest {
@Override
public void onNext( final List<MarkedEdge> edges ) {
- log.info("Read {} edges", edges.size());
+ logger.info("Read {} edges", edges.size());
}
} );
@@ -245,7 +244,7 @@ public class GraphManagerLoadTest {
latch.await();
- log.info( "Total time to read {} entries {} ms", readCount, timer.getTime() );
+ logger.info( "Total time to read {} entries {} ms", readCount, timer.getTime() );
return true;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
index 0cc0e88..3ae3ff1 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
@@ -42,7 +42,6 @@ import javax.annotation.Nullable;
import org.apache.usergrid.StressTest;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
@@ -83,7 +82,7 @@ import static org.junit.Assert.fail;
public class GraphManagerShardConsistencyIT {
- private static final Logger log = LoggerFactory.getLogger( GraphManagerShardConsistencyIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( GraphManagerShardConsistencyIT.class );
private static final MetricRegistry registry = new MetricRegistry();
@@ -135,7 +134,7 @@ public class GraphManagerShardConsistencyIT {
reporter =
- Slf4jReporter.forRegistry( registry ).outputTo( log ).convertRatesTo( TimeUnit.SECONDS )
+ Slf4jReporter.forRegistry( registry ).outputTo(logger).convertRatesTo( TimeUnit.SECONDS )
.convertDurationsTo( TimeUnit.MILLISECONDS ).build();
@@ -228,7 +227,7 @@ public class GraphManagerShardConsistencyIT {
final long minExecutionTime = graphFig.getShardMinDelta() + graphFig.getShardCacheTimeout();
- log.info( "Writing {} edges per worker on {} workers in {} injectors", workerWriteLimit, numWorkersPerInjector,
+ logger.info( "Writing {} edges per worker on {} workers in {} injectors", workerWriteLimit, numWorkersPerInjector,
numInjectors );
@@ -284,7 +283,7 @@ public class GraphManagerShardConsistencyIT {
@Override
public void onSuccess( @Nullable final Long result ) {
- log.info( "Successfully ran the read, re-running" );
+ logger.info( "Successfully ran the read, re-running" );
executor.submit( new ReadWorker( gmf, generator, writeCount, readMeter ) );
}
@@ -292,7 +291,7 @@ public class GraphManagerShardConsistencyIT {
@Override
public void onFailure( final Throwable t ) {
failures.add( t );
- log.error( "Failed test!", t );
+ logger.error( "Failed test!", t );
}
} );
}
@@ -337,7 +336,7 @@ public class GraphManagerShardConsistencyIT {
final ShardEntryGroup group = groups.next();
shardEntryGroups.add( group );
- log.info( "Compaction pending status for group {} is {}", group, group.isCompactionPending() );
+ logger.info( "Compaction pending status for group {} is {}", group, group.isCompactionPending() );
if ( !group.isCompactionPending() ) {
compactedCount++;
@@ -347,7 +346,7 @@ public class GraphManagerShardConsistencyIT {
//we're done
if ( compactedCount >= expectedShardCount ) {
- log.info( "All compactions complete, sleeping" );
+ logger.info( "All compactions complete, sleeping" );
// final Object mutex = new Object();
//
@@ -467,7 +466,7 @@ public class GraphManagerShardConsistencyIT {
final long minExecutionTime = graphFig.getShardMinDelta() + graphFig.getShardCacheTimeout();
- log.info( "Writing {} edges per worker on {} workers in {} injectors", workerWriteLimit, numWorkersPerInjector,
+ logger.info( "Writing {} edges per worker on {} workers in {} injectors", workerWriteLimit, numWorkersPerInjector,
numInjectors );
@@ -518,11 +517,11 @@ public class GraphManagerShardConsistencyIT {
shardCount++;
- log.info( "Compaction pending status for group {} is {}", group, group.isCompactionPending() );
+ logger.info( "Compaction pending status for group {} is {}", group, group.isCompactionPending() );
}
- log.info( "found {} shard groups", shardCount );
+ logger.info( "found {} shard groups", shardCount );
//now mark and delete all the edges
@@ -559,7 +558,7 @@ public class GraphManagerShardConsistencyIT {
@Override
public void onSuccess( @Nullable final Long result ) {
- log.info( "Successfully ran the read, re-running" );
+ logger.info( "Successfully ran the read, re-running" );
executor.submit( new ReadWorker( gmf, generator, writeCount, readMeter ) );
}
@@ -567,7 +566,7 @@ public class GraphManagerShardConsistencyIT {
@Override
public void onFailure( final Throwable t ) {
failures.add( t );
- log.error( "Failed test!", t );
+ logger.error( "Failed test!", t );
}
} );
@@ -608,7 +607,7 @@ public class GraphManagerShardConsistencyIT {
group = groups.next();
- log.info( "Shard size for group is {}", group.getReadShards() );
+ logger.info( "Shard size for group is {}", group.getReadShards() );
shardCount += group.getReadShards().size();
}
@@ -616,7 +615,7 @@ public class GraphManagerShardConsistencyIT {
//we're done, 1 shard remains, we have a group, and it's our default shard
if ( shardCount == 1 && group != null && group.getMinShard().getShardIndex() == Shard.MIN_SHARD.getShardIndex() ) {
- log.info( "All compactions complete," );
+ logger.info( "All compactions complete," );
break;
}
@@ -673,7 +672,7 @@ public class GraphManagerShardConsistencyIT {
if ( i % 1000 == 0 ) {
- log.info( " Wrote: " + i );
+ logger.info( " Wrote: " + i );
}
}
@@ -716,10 +715,10 @@ public class GraphManagerShardConsistencyIT {
.countLong().toBlocking().last();
- log.info( "Completed reading {} edges", returnedEdgeCount );
+ logger.info( "Completed reading {} edges", returnedEdgeCount );
if ( writeCount != returnedEdgeCount ) {
- log.warn( "Unexpected edge count returned!!! Expected {} but was {}", writeCount,
+ logger.warn( "Unexpected edge count returned!!! Expected {} but was {}", writeCount,
returnedEdgeCount );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java
index 98065ce..be1eee4 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java
@@ -56,7 +56,7 @@ import static org.mockito.Mockito.when;
@UseModules(TestGraphModule.class)
@Category(StressTest.class)
public class GraphManagerStressTest {
- private static final Logger log = LoggerFactory.getLogger( GraphManagerStressTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( GraphManagerStressTest.class );
@Inject
private GraphManagerFactory factory;
@@ -120,7 +120,7 @@ public class GraphManagerStressTest {
.toBlocking().toIterable();
for ( MarkedEdge edge : edges ) {
- log.debug( "Firing on next for edge {}", edge );
+ logger.debug( "Firing on next for edge {}", edge );
subscriber.onNext( edge );
}
@@ -250,12 +250,12 @@ public class GraphManagerStressTest {
ids.add( returned );
if ( i % 1000 == 0 ) {
- log.info( " Wrote: " + i );
+ logger.info( " Wrote: " + i );
}
}
timer.stop();
- log.info( "Total time to write {} entries {}ms", limit, timer.getTime() );
+ logger.info( "Total time to write {} entries {}ms", limit, timer.getTime() );
timer.reset();
timer.start();
@@ -290,7 +290,7 @@ public class GraphManagerStressTest {
assertEquals( 0, ids.size() );
- log.info( "Total time to read {} entries {}ms", limit, timer.getTime() );
+ logger.info( "Total time to read {} entries {}ms", limit, timer.getTime() );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/NodeDeleteListenerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/NodeDeleteListenerTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/NodeDeleteListenerTest.java
index 5a5df79..438a978 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/NodeDeleteListenerTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/NodeDeleteListenerTest.java
@@ -70,7 +70,7 @@ import static org.mockito.Mockito.when;
@UseModules( { TestGraphModule.class } )
public class NodeDeleteListenerTest {
- private static final Logger log = LoggerFactory.getLogger( NodeDeleteListenerTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( NodeDeleteListenerTest.class );
@Inject
@@ -359,8 +359,8 @@ public class NodeDeleteListenerTest {
assertEquals( edgeCount, countSaved );
- log.info( "Saved {} source edges", sourceCount );
- log.info( "Saved {} target edges", targetCount );
+ logger.info( "Saved {} source edges", sourceCount );
+ logger.info( "Saved {} target edges", targetCount );
long deleteVersion = Long.MAX_VALUE;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationTest.java
index d81413e..928d519 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationTest.java
@@ -27,7 +27,6 @@ import java.util.UUID;
import org.apache.usergrid.StressTest;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -76,7 +75,7 @@ import static org.mockito.Mockito.when;
public abstract class EdgeSerializationTest {
- private static final Logger log = LoggerFactory.getLogger( EdgeSerializationTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( EdgeSerializationTest.class );
@Inject
@Rule
@@ -719,7 +718,7 @@ public abstract class EdgeSerializationTest {
timestamp++;
}
- log.info( "Flushing edges" );
+ logger.info( "Flushing edges" );
batch.execute();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/TestCount.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/TestCount.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/TestCount.java
index 0c09e81..07eb9ab 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/TestCount.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/TestCount.java
@@ -40,7 +40,7 @@ import static org.junit.Assert.assertEquals;
*/
public class TestCount {
- private static final Logger log = LoggerFactory.getLogger( TestCount.class );
+ private static final Logger logger = LoggerFactory.getLogger( TestCount.class );
@Test
@@ -125,7 +125,7 @@ public class TestCount {
final Integer value = values.get( i );
- log.info( "Emitting {}", value );
+ logger.info( "Emitting {}", value );
subscriber.onNext( value );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index f26a018..8e790ff 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -69,7 +69,7 @@ import static org.junit.Assert.fail;
@UseModules( { TestIndexModule.class } )
public class EntityIndexTest extends BaseIT {
- private static final Logger log = LoggerFactory.getLogger(EntityIndexTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(EntityIndexTest.class);
@Inject
public EntityIndexFactory eif;
@@ -164,7 +164,7 @@ public class EntityIndexTest extends BaseIT {
timer.stop();
assertEquals(2, candidateResults.size());
- log.debug("Query time {}ms", timer.getTime());
+ logger.debug("Query time {}ms", timer.getTime());
final CandidateResult candidate1 = candidateResults.get(0);
@@ -266,7 +266,7 @@ public class EntityIndexTest extends BaseIT {
testQuery( searchEdge, searchTypes, "name = 'Lowe Kelley'", 1 );
- log.info("hi");
+ logger.info("hi");
}
@@ -309,7 +309,7 @@ public class EntityIndexTest extends BaseIT {
indexProducer.put(batch.build()).subscribe();;
EntityIndex.IndexRefreshCommandInfo info = entityIndex.refreshAsync().toBlocking().first();
long time = info.getExecutionTime();
- log.info("refresh took ms:" + time);
+ logger.info("refresh took ms:" + time);
}
@@ -342,7 +342,7 @@ public class EntityIndexTest extends BaseIT {
}
timer.stop();
- log.info( "Total time to index {} entries {}ms, average {}ms/entry",
+ logger.info( "Total time to index {} entries {}ms, average {}ms/entry",
new Object[] { count, timer.getTime(), timer.getTime() / count } );
}
@@ -435,7 +435,7 @@ public class EntityIndexTest extends BaseIT {
timer.stop();
assertEquals(num, candidateResults.size());
- log.debug("Query time {}ms", timer.getTime());
+ logger.debug("Query time {}ms", timer.getTime());
return candidateResults;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/launcher/src/main/java/org/apache/usergrid/launcher/EmbeddedServerHelper.java
----------------------------------------------------------------------
diff --git a/stack/launcher/src/main/java/org/apache/usergrid/launcher/EmbeddedServerHelper.java b/stack/launcher/src/main/java/org/apache/usergrid/launcher/EmbeddedServerHelper.java
index b3b72c2..441fe21 100644
--- a/stack/launcher/src/main/java/org/apache/usergrid/launcher/EmbeddedServerHelper.java
+++ b/stack/launcher/src/main/java/org/apache/usergrid/launcher/EmbeddedServerHelper.java
@@ -19,7 +19,7 @@ package org.apache.usergrid.launcher;
/** @author Ran Tavory (rantav@gmail.com) */
public class EmbeddedServerHelper {
- private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger( EmbeddedServerHelper.class );
+ private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger( EmbeddedServerHelper.class );
private static final String TMP = "tmp";
@@ -66,10 +66,10 @@ public class EmbeddedServerHelper {
System.setProperty( "log4j.configuration", "file:" + TMP + "/log4j.properties" );
System.setProperty( "cassandra-foreground", "true" );
- log.info( "Starting executor" );
+ logger.info( "Starting executor" );
executor.execute( new ITRunner() );
- log.info( "Started executor" );
+ logger.info( "Started executor" );
}
else {
cassandraDaemon.start();
@@ -78,7 +78,7 @@ public class EmbeddedServerHelper {
try {
java.util.concurrent.TimeUnit.SECONDS.sleep( 3 );
- log.info( "Done sleeping" );
+ logger.info( "Done sleeping" );
}
catch ( InterruptedException e ) {
throw new AssertionError( e );
@@ -93,7 +93,7 @@ public class EmbeddedServerHelper {
}
executor.shutdown();
executor.shutdownNow();
- log.info( "Teardown complete" );
+ logger.info( "Teardown complete" );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java
index 5ce3c2d..1067365 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/PartialUpdateTest.java
@@ -36,7 +36,7 @@ import static org.junit.Assert.*;
* Partial update test.
*/
public class PartialUpdateTest extends AbstractRestIT {
- private static final Logger log = LoggerFactory.getLogger(PartialUpdateTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(PartialUpdateTest.class);
double latitude = 37.772837;
double longitude = -122.409895;
@@ -85,7 +85,7 @@ public class PartialUpdateTest extends AbstractRestIT {
// retrieve the user from the backend
userNode = this.app().collection("users").entity(userNode).get();
- log.info(userNode.toString());
+ logger.info(userNode.toString());
// verify that the user was returned
assertNotNull(userNode);
@@ -98,9 +98,9 @@ public class PartialUpdateTest extends AbstractRestIT {
// Verify that the location was updated correctly AND that
// it is not the same object reference from the original POST
- log.info(geolocation.get("latitude") + " != "
+ logger.info(geolocation.get("latitude") + " != "
+ Double.parseDouble(((Map<String, Object>) userNode.get("location")).get("latitude").toString()));
- log.info(geolocation.get("longitude") + " != "
+ logger.info(geolocation.get("longitude") + " != "
+ Double.parseDouble(((Map<String, Object>) userNode.get("location")).get("longitude").toString()));
assertNotSame(geolocation.get("latitude"),
Double.parseDouble(((Map<String, Object>) userNode.get("location")).get("latitude").toString()));
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatRuntime.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatRuntime.java b/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatRuntime.java
index 4c09565..e1d2a09 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatRuntime.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatRuntime.java
@@ -41,7 +41,7 @@ import javax.ws.rs.client.WebTarget;
* Start and stop embedded Tomcat.
*/
public class TomcatRuntime extends ExternalResource {
- private static final Logger log = LoggerFactory.getLogger( TomcatRuntime.class );
+ private static final Logger logger = LoggerFactory.getLogger( TomcatRuntime.class );
private static final String WEBAPP_PATH = System.getProperty("webapp.directory");
@@ -137,9 +137,9 @@ public class TomcatRuntime extends ExternalResource {
tomcat.addWebapp( "/", new File( webAppsPath ).getAbsolutePath() );
- log.info( "-----------------------------------------------------------------" );
- log.info( "Starting Tomcat embedded port {} dir {}", port, dataDir.getAbsolutePath() );
- log.info( "-----------------------------------------------------------------" );
+ logger.info( "-----------------------------------------------------------------" );
+ logger.info( "Starting Tomcat embedded port {} dir {}", port, dataDir.getAbsolutePath() );
+ logger.info( "-----------------------------------------------------------------" );
tomcat.start();
waitForTomcat();
@@ -178,12 +178,12 @@ public class TomcatRuntime extends ExternalResource {
Client c = ClientBuilder.newClient();
WebTarget wr = c.target( url );
wr.request().get( String.class );
- log.info( "Tomcat is started." );
+ logger.info( "Tomcat is started." );
started = true;
break;
}
catch ( Exception e ) {
- log.info( "Waiting for Tomcat on url {}", url );
+ logger.info( "Waiting for Tomcat on url {}", url );
}
}
if ( !started ) {
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
index 3e591cb..8d647e7 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
@@ -25,8 +25,6 @@ import org.apache.usergrid.rest.test.resource.model.Entity;
import org.apache.usergrid.services.assets.data.AssetUtils;
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
import org.glassfish.jersey.media.multipart.MultiPart;
-import org.glassfish.jersey.media.multipart.MultiPartFeature;
-import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
import org.glassfish.jersey.media.multipart.file.StreamDataBodyPart;
import org.junit.After;
import org.junit.Assert;
@@ -50,7 +48,7 @@ import static org.junit.Assert.*;
public class AssetResourceIT extends AbstractRestIT {
private String access_token;
- private static final Logger LOG = LoggerFactory.getLogger( AssetResourceIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( AssetResourceIT.class );
private Map<String, Object> originalProperties;
@@ -213,13 +211,13 @@ public class AssetResourceIT extends AbstractRestIT {
FormDataMultiPart form = new FormDataMultiPart().field( "file", data, MediaType.MULTIPART_FORM_DATA_TYPE );
ApiResponse postResponse = pathResource( getOrgAppPath( "foos" ) ).post( form );
UUID assetId = postResponse.getEntities().get(0).getUuid();
- LOG.info( "Waiting for upload to finish..." );
+ logger.info( "Waiting for upload to finish..." );
Thread.sleep( 2000 );
// check that entire file was uploaded
ApiResponse getResponse = pathResource( getOrgAppPath( "foos/" +assetId ) ).get( ApiResponse.class );
- LOG.info( "Upload complete!" );
+ logger.info( "Upload complete!" );
InputStream is = pathResource( getOrgAppPath( "foos/" + assetId ) ).getAssetAsStream();
byte[] foundData = IOUtils.toByteArray( is );
assertEquals( data.length, foundData.length );
@@ -252,7 +250,7 @@ public class AssetResourceIT extends AbstractRestIT {
UUID assetId = postResponse.getEntities().get(0).getUuid();
String errorMessage = null;
- LOG.info( "Waiting for upload to finish..." );
+ logger.info( "Waiting for upload to finish..." );
Thread.sleep( 2000 );
// attempt to get asset entity, it should contain error
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AwsAssetResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AwsAssetResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AwsAssetResourceIT.java
index b3f3008..c1e87a6 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AwsAssetResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AwsAssetResourceIT.java
@@ -48,7 +48,7 @@ public class AwsAssetResourceIT extends AbstractRestIT {
private String access_token;
private Map<String, Object> originalProperties;
- private static final Logger LOG = LoggerFactory.getLogger( AwsAssetResourceIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( AwsAssetResourceIT.class );
/**
* Mark tests as ignored if no AWS creds are present
@@ -152,13 +152,13 @@ public class AwsAssetResourceIT extends AbstractRestIT {
FormDataMultiPart form = new FormDataMultiPart().field( "file", data, MediaType.MULTIPART_FORM_DATA_TYPE );
ApiResponse postResponse = pathResource( getOrgAppPath( "foos" ) ).post( form );
UUID assetId = postResponse.getEntities().get(0).getUuid();
- LOG.info( "Waiting for upload to finish..." );
+ logger.info( "Waiting for upload to finish..." );
Thread.sleep( 5000 );
// check that entire file was uploaded
ApiResponse getResponse = pathResource( getOrgAppPath( "foos/" +assetId ) ).get( ApiResponse.class );
- LOG.info( "Upload complete!" );
+ logger.info( "Upload complete!" );
InputStream is = pathResource( getOrgAppPath( "foos/" + assetId ) ).getAssetAsStream();
byte[] foundData = IOUtils.toByteArray( is );
assertEquals( data.length, foundData.length );
@@ -321,13 +321,13 @@ public class AwsAssetResourceIT extends AbstractRestIT {
FormDataMultiPart form = new FormDataMultiPart().field( "file", data, MediaType.MULTIPART_FORM_DATA_TYPE );
ApiResponse postResponse = pathResource( getOrgAppPath( "foos" ) ).post( form );
UUID assetId = postResponse.getEntities().get(0).getUuid();
- LOG.info( "Waiting for upload to finish..." );
+ logger.info( "Waiting for upload to finish..." );
Thread.sleep( 5000 );
// check that entire file was uploaded
ApiResponse getResponse = pathResource( getOrgAppPath( "foos/" +assetId ) ).get( ApiResponse.class );
- LOG.info( "Upload complete!" );
+ logger.info( "Upload complete!" );
InputStream is = pathResource( getOrgAppPath( "foos/" + assetId ) ).getAssetAsStream();
byte[] foundData = IOUtils.toByteArray( is );
assertEquals( data.length, foundData.length );
@@ -355,7 +355,7 @@ public class AwsAssetResourceIT extends AbstractRestIT {
UUID assetId = postResponse.getEntities().get(0).getUuid();
String errorMessage = null;
- LOG.info( "Waiting for upload to finish..." );
+ logger.info( "Waiting for upload to finish..." );
Thread.sleep( 1000 );
// attempt to get asset entity, it should contain error
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
index cc9eaa5..d36d0a1 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
@@ -18,9 +18,6 @@ package org.apache.usergrid.rest.applications.collection.users;
import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.UniformInterfaceException;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
import java.util.ArrayList;
import java.util.HashMap;
@@ -65,7 +62,7 @@ import static org.junit.Assert.fail;
public class UserResourceIT extends AbstractRestIT {
- private static final Logger log = LoggerFactory.getLogger(UserResourceIT.class);
+ private static final Logger logger = LoggerFactory.getLogger(UserResourceIT.class);
UserRepo userRepo;
CollectionEndpoint usersResource;
CollectionEndpoint userResource;
@@ -700,7 +697,7 @@ public class UserResourceIT extends AbstractRestIT {
@Test
public void test_POST_batch() throws IOException {
- log.info("UserResourceIT.test_POST_batch");
+ logger.info("UserResourceIT.test_POST_batch");
List<Entity> batch = new ArrayList<>();
@@ -1014,7 +1011,7 @@ public class UserResourceIT extends AbstractRestIT {
assertTrue(false);
} catch (ClientErrorException uie) {
status = uie.getResponse().getStatus();
- log.info("Error Response Body: " + uie.getResponse().readEntity(String.class));
+ logger.info("Error Response Body: " + uie.getResponse().readEntity(String.class));
}
assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(), status);
@@ -1025,7 +1022,7 @@ public class UserResourceIT extends AbstractRestIT {
assertTrue(false);
} catch (ClientErrorException uie) {
status = uie.getResponse().getStatus();
- log.info("Error Response Body: " + uie.getResponse().readEntity(String.class));
+ logger.info("Error Response Body: " + uie.getResponse().readEntity(String.class));
}
assertEquals(Response.Status.FORBIDDEN.getStatusCode(), status);
@@ -1215,7 +1212,7 @@ public class UserResourceIT extends AbstractRestIT {
fail("Should have thrown an exception");
} catch (BadRequestException uie) {
status = uie.getResponse().getStatus();
- log.info("Error Response Body: {}" , uie.getResponse().getEntity());
+ logger.info("Error Response Body: {}" , uie.getResponse().getEntity());
}
assertEquals( Response.Status.BAD_REQUEST.getStatusCode(), status);
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/extensions/TestResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/extensions/TestResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/extensions/TestResource.java
index 7e6f278..81af791 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/extensions/TestResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/extensions/TestResource.java
@@ -21,7 +21,6 @@ import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
-import org.junit.Ignore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
@@ -34,11 +33,11 @@ import org.apache.usergrid.rest.applications.users.AbstractUserExtensionResource
@Produces(MediaType.APPLICATION_JSON)
public class TestResource extends AbstractUserExtensionResource {
- private static final Logger log = LoggerFactory.getLogger( TestResource.class );
+ private static final Logger logger = LoggerFactory.getLogger( TestResource.class );
public TestResource() {
- log.info( "TestResource" );
+ logger.info( "TestResource" );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
index 16441fe..4bdd3fc 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
@@ -36,7 +36,7 @@ import static org.junit.Assert.*;
* @since 4.0
*/
public class AndOrQueryTest extends QueryTestBase {
- private static final Logger log = LoggerFactory.getLogger(AndOrQueryTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(AndOrQueryTest.class);
/**
@@ -154,7 +154,7 @@ public class AndOrQueryTest extends QueryTestBase {
for (int i = 0; i < returnSize; i++, index--) {
count++;
Entity activity = activities.getResponse().getEntities().get(i);
- log.info(String.valueOf(activity.get("ordinal")) + " " + String.valueOf(activity.get("madeup")));
+ logger.info(String.valueOf(activity.get("ordinal")) + " " + String.valueOf(activity.get("madeup")));
//if the entity is in the first half, the property "madeup" should be false
if (index < numOfEntities / 2) {
assertFalse(Boolean.parseBoolean(String.valueOf(activity.get("madeup"))));
@@ -198,7 +198,7 @@ public class AndOrQueryTest extends QueryTestBase {
count++;
Entity activity = activities.getResponse().getEntities().get(i);
long ordinal = Long.parseLong(String.valueOf(activity.get("ordinal")));
- log.info(ordinal + " " + String.valueOf(activity.get("verb")));
+ logger.info(ordinal + " " + String.valueOf(activity.get("verb")));
//if the entity is in the first three quarters, the property "verb" should be "go"
if (ordinal < (numOfEntities - numOfEntities / 4)) {
assertEquals("go", String.valueOf(activity.get("verb")));
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 a3d8391..e052264 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
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertEquals;
* @since 4.0
*/
public class OrderByTest extends QueryTestBase {
- private static final Logger log = LoggerFactory.getLogger(OrderByTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(OrderByTest.class);
@Test
public void orderByLongAsc() throws IOException {
@@ -241,7 +241,7 @@ public class OrderByTest extends QueryTestBase {
for (int i = 0; i < 20; i++) {
props.put("ordinal", i);
Entity activity = this.app().collection("activity").post(props);
- log.info("Created", activity.get("created").toString());
+ logger.info("Created", activity.get("created").toString());
if (i == 5) {
created = Long.parseLong(activity.get("created").toString());
}
@@ -331,8 +331,8 @@ public class OrderByTest extends QueryTestBase {
props.put("ordinal", i);
Entity e = this.app().collection("activity").post(props);
activities[i] = e;
- log.info(String.valueOf(e.get("uuid").toString()));
- log.info(String.valueOf(Long.parseLong(activities[0].get("created").toString())));
+ logger.info(String.valueOf(e.get("uuid").toString()));
+ logger.info(String.valueOf(Long.parseLong(activities[0].get("created").toString())));
}
refreshIndex();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/QueryTestBase.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/QueryTestBase.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/QueryTestBase.java
index 48ddf51..f7eb3fe 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/QueryTestBase.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/QueryTestBase.java
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
* A base class containing common methods used by query tests
*/
public class QueryTestBase extends AbstractRestIT {
- private static final Logger log = LoggerFactory.getLogger(QueryTestBase.class);
+ private static final Logger logger = LoggerFactory.getLogger(QueryTestBase.class);
/**
* Create a number of entities in the specified collection
* with properties to make them independently searchable
@@ -62,7 +62,7 @@ public class QueryTestBase extends AbstractRestIT {
}
//create the entity in the desired collection and add it to the return array
entities[i] = this.app().collection(collectionName).post(props);
- log.info(entities[i].entrySet().toString());
+ logger.info(entities[i].entrySet().toString());
}
//refresh the index so that they are immediately searchable
this.refreshIndex();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 f2a8976..f9fe8b8 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
@@ -24,15 +24,12 @@ import org.apache.usergrid.services.ServiceManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.HashMap;
-import java.util.Map;
-
public class JobScheduler{
public static final long SCHEDULER_GRACE_PERIOD = 250;
private final EntityManager em;
protected ServiceManager sm;
- private static final Logger LOG = LoggerFactory.getLogger(NotificationsService.class);
+ private static final Logger logger = LoggerFactory.getLogger(NotificationsService.class);
public JobScheduler(ServiceManager sm,EntityManager em){
this.sm=sm; this.em = em;
@@ -49,7 +46,7 @@ public class JobScheduler{
SchedulerService scheduler = getSchedulerService();
scheduler.createJob("notificationBatchJob", soonestPossible, jobData);
- LOG.info("notification {} batch scheduled for delivery", notification.getUuid());
+ logger.info("notification {} batch scheduled for delivery", notification.getUuid());
}
public boolean scheduleQueueJob(Notification notification) throws Exception {
return scheduleQueueJob(notification,false);
@@ -73,7 +70,7 @@ public class JobScheduler{
jobData.setProperty("deliver", notification.getDeliver());
SchedulerService scheduler = getSchedulerService();
scheduler.createJob("queueJob", scheduleAt, jobData);
- LOG.info("notification {} scheduled for queuing", notification.getUuid());
+ logger.info("notification {} scheduled for queuing", notification.getUuid());
}
return scheduled;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 202971d..36c6776 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
@@ -68,7 +68,7 @@ public class NotificationsService extends AbstractCollectionService {
private Timer postTimer;
private static final int PAGE = 100;
- private static final Logger LOG = LoggerFactory.getLogger(NotificationsService.class);
+ private static final Logger logger = LoggerFactory.getLogger(NotificationsService.class);
//need a mocking framework, this is to substitute for no mocking
static final String MESSAGE_PROPERTY_DEVICE_UUID = "deviceUUID";
@@ -86,7 +86,7 @@ public class NotificationsService extends AbstractCollectionService {
private QueueManagerFactory queueManagerFactory;
public NotificationsService() {
- LOG.info("/notifications");
+ logger.info("/notifications");
}
@Override
@@ -129,7 +129,7 @@ public class NotificationsService extends AbstractCollectionService {
@Override
public ServiceResults postCollection(ServiceContext context) throws Exception {
- LOG.info("NotificationService: start request.");
+ logger.info("NotificationService: start request.");
Timer.Context timer = postTimer.time();
postMeter.mark();
try {
@@ -149,16 +149,16 @@ public class NotificationsService extends AbstractCollectionService {
properties.put("started", notification.getStarted());
properties.put("state", notification.getState());
notification.addProperties(properties);
- LOG.info("ApplicationQueueMessage: notification {} properties updated in duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
+ logger.info("ApplicationQueueMessage: notification {} properties updated in duration {} ms", notification.getUuid(), System.currentTimeMillis() - now);
}
long now = System.currentTimeMillis();
notificationQueueManager.queueNotification(notification, null);
- LOG.info("NotificationService: notification {} post queue duration {} ms ", notification.getUuid(), System.currentTimeMillis() - now);
+ logger.info("NotificationService: notification {} post queue duration {} ms ", notification.getUuid(), System.currentTimeMillis() - now);
// future: somehow return 202?
return results;
}catch (Exception e){
- LOG.error("serialization failed",e);
+ logger.error("serialization failed",e);
throw e;
}finally {
timer.stop();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 bcf7b49..e7d36e2 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
@@ -50,7 +50,7 @@ public class QueueListener {
public long DEFAULT_SLEEP = 5000;
- private static final Logger LOG = LoggerFactory.getLogger(QueueListener.class);
+ private static final Logger logger = LoggerFactory.getLogger(QueueListener.class);
private MetricsFactory metricsService;
@@ -93,7 +93,7 @@ public class QueueListener {
// boolean shouldRun = new Boolean(properties.getProperty("usergrid.notifications.listener.run", "false"));
- LOG.info("QueueListener: starting.");
+ logger.info("QueueListener: starting.");
int threadCount = 0;
try {
@@ -113,23 +113,23 @@ public class QueueListener {
pool = Executors.newFixedThreadPool(maxThreads);
while (threadCount++ < maxThreads) {
- LOG.info("QueueListener: Starting thread {}.", threadCount);
+ logger.info("QueueListener: Starting thread {}.", threadCount);
Runnable task = new Runnable() {
@Override
public void run() {
try {
execute();
} catch (Exception e) {
- LOG.error("failed to start push", e);
+ logger.error("failed to start push", e);
}
}
};
futures.add( pool.submit(task));
}
} catch (Exception e) {
- LOG.error("QueueListener: failed to start:", e);
+ logger.error("QueueListener: failed to start:", e);
}
- LOG.info("QueueListener: done starting.");
+ logger.info("QueueListener: done starting.");
}
private void execute(){
@@ -139,11 +139,11 @@ public class QueueListener {
Thread.currentThread().setName("Notifications_Processor"+UUID.randomUUID());
final AtomicInteger consecutiveExceptions = new AtomicInteger();
- LOG.info("QueueListener: Starting execute process.");
+ logger.info("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());
- LOG.info("getting from queue {} ", queueName);
+ logger.info("getting from queue {} ", queueName);
QueueScope queueScope = new QueueScopeImpl( queueName, QueueScope.RegionImplementation.LOCAL);
QueueManager queueManager = TEST_QUEUE_MANAGER != null ? TEST_QUEUE_MANAGER : queueManagerFactory.getQueueManager(queueScope);
// run until there are no more active jobs
@@ -157,16 +157,19 @@ public class QueueListener {
rx.Observable.from(queueManager.getMessages(getBatchSize(), MESSAGE_TRANSACTION_TIMEOUT, 10000, ApplicationQueueMessage.class))
.buffer(getBatchSize())
.doOnNext(messages -> {
+
try {
- LOG.info("retrieved batch of {} messages from queue {} ", messages.size(),queueName);
+ logger.info("retrieved batch of {} messages from queue {} ", messages.size(),queueName);
if (messages.size() > 0) {
HashMap<UUID, List<QueueMessage>> messageMap = new HashMap<>(messages.size());
+
//group messages into hash map by app id
for (QueueMessage message : messages) {
//TODO: stop copying around this area as it gets notification specific.
ApplicationQueueMessage queueMessage = (ApplicationQueueMessage) message.getBody();
UUID applicationId = queueMessage.getApplicationId();
+
//Groups queue messages by application Id, ( they are all probably going to the same place )
if (!messageMap.containsKey(applicationId)) {
//For each app id it sends the set.
@@ -177,61 +180,67 @@ public class QueueListener {
messageMap.get(applicationId).add(message);
}
}
+
long now = System.currentTimeMillis();
Observable merge = null;
+
//send each set of app ids together
for (Map.Entry<UUID, List<QueueMessage>> entry : messageMap.entrySet()) {
UUID applicationId = entry.getKey();
ApplicationQueueManager manager = queueManagerMap.get(applicationId);
- LOG.info("send batch for app {} of {} messages", entry.getKey(), entry.getValue().size());
+ logger.info("send batch for app {} of {} messages", entry.getKey(), entry.getValue().size());
Observable current = manager.sendBatchToProviders(entry.getValue(),queueName);
+
if(merge == null)
merge = current;
else {
merge = Observable.merge(merge,current);
}
}
+
if(merge!=null) {
merge.toBlocking().lastOrDefault(null);
}
queueManager.commitMessages(messages);
meter.mark(messages.size());
- LOG.info("sent batch {} messages duration {} ms", messages.size(),System.currentTimeMillis() - now);
+ logger.info("sent batch {} messages duration {} ms", messages.size(),System.currentTimeMillis() - now);
if(sleepBetweenRuns > 0) {
- LOG.info("sleep between rounds...sleep...{}", sleepBetweenRuns);
+ logger.info("sleep between rounds...sleep...{}", sleepBetweenRuns);
Thread.sleep(sleepBetweenRuns);
}
+
if(runCount.incrementAndGet() % consecutiveCallsToRemoveDevices == 0){
for(ApplicationQueueManager applicationQueueManager : queueManagerMap.asMap().values()){
try {
applicationQueueManager.asyncCheckForInactiveDevices();
}catch (Exception inactiveDeviceException){
- LOG.error("Inactive Device Get failed",inactiveDeviceException);
+ logger.error("Inactive Device Get failed",inactiveDeviceException);
}
}
//clear everything
runCount.set(0);
}
}
+
else{
- LOG.info("no messages...sleep...{}", sleepWhenNoneFound);
+ logger.info("no messages...sleep...{}", sleepWhenNoneFound);
Thread.sleep(sleepWhenNoneFound);
}
timerContext.stop();
//send to the providers
consecutiveExceptions.set(0);
}catch (Exception ex){
- LOG.error("failed to dequeue",ex);
+ logger.error("failed to dequeue",ex);
try {
long sleeptime = sleepWhenNoneFound*consecutiveExceptions.incrementAndGet();
long maxSleep = 15000;
sleeptime = sleeptime > maxSleep ? maxSleep : sleeptime ;
- LOG.info("sleeping due to failures {} ms", sleeptime);
+ logger.info("sleeping due to failures {} ms", sleeptime);
Thread.sleep(sleeptime);
}catch (InterruptedException ie){
- LOG.info("sleep interrupted");
+ logger.info("sleep interrupted");
}
}
})
@@ -252,7 +261,7 @@ public class QueueListener {
try {
queueManagerNotifiication.getValue().stop();
} catch (Exception ie) {
- LOG.error("Failed to shutdown from cache", ie);
+ logger.error("Failed to shutdown from cache", ie);
}
}
}).build(new CacheLoader<UUID, ApplicationQueueManager>() {
@@ -271,7 +280,7 @@ public class QueueListener {
);
return manager;
} catch (Exception e) {
- LOG.error("Could not instantiate queue manager", e);
+ logger.error("Could not instantiate queue manager", e);
return null;
}
}
@@ -279,7 +288,7 @@ public class QueueListener {
}
public void stop(){
- LOG.info("stop processes");
+ logger.info("stop processes");
if(futures == null){
return;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 a74cc14..6c7e53c 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
@@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicLong;
public class TaskManager {
- private static final Logger LOG = LoggerFactory.getLogger(TaskManager.class);
+ private static final Logger logger = LoggerFactory.getLogger(TaskManager.class);
private Notification notification;
private AtomicLong successes = new AtomicLong();
@@ -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 (LOG.isDebugEnabled()) {
- LOG.debug("REMOVED {}", deviceUUID);
+ if (logger.isDebugEnabled()) {
+ logger.debug("REMOVED {}", deviceUUID);
}
try {
- if (LOG.isDebugEnabled()) {
- LOG.debug("notification {} removing device {} from remaining", notification.getUuid(), deviceUUID);
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} removing device {} from remaining", notification.getUuid(), deviceUUID);
}
EntityRef deviceRef = new SimpleEntityRef(Device.ENTITY_TYPE, deviceUUID);
if (receipt != null) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("notification {} sent to device {}. saving receipt.", notification.getUuid(), deviceUUID);
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} sent to device {}. saving receipt.", notification.getUuid(), deviceUUID);
}
receipt.setSent(System.currentTimeMillis());
this.saveReceipt(notification, deviceRef, receipt,false);
- if (LOG.isDebugEnabled()) {
- LOG.debug("notification {} receipt saved for device {}", notification.getUuid(), deviceUUID);
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} receipt saved for device {}", notification.getUuid(), deviceUUID);
}
successes.incrementAndGet();
}
if (newProviderId != null) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("notification {} replacing device {} notifierId", notification.getUuid(), deviceUUID);
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} replacing device {} notifierId", notification.getUuid(), deviceUUID);
}
replaceProviderId(deviceRef, notifier, newProviderId);
}
- if (LOG.isDebugEnabled()) {
- LOG.debug("notification {} completed device {}", notification.getUuid(), deviceUUID);
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} completed device {}", notification.getUuid(), deviceUUID);
}
} finally {
- if (LOG.isDebugEnabled()) {
- LOG.debug("COUNT is: {}", successes.get());
+ if (logger.isDebugEnabled()) {
+ logger.debug("COUNT is: {}", successes.get());
}
if (hasFinished) { //process has finished but notifications are still coming in
finishedBatch();
@@ -99,12 +99,12 @@ public class TaskManager {
public void failed(Notifier notifier, Receipt receipt, UUID deviceUUID, Object code, String message) throws Exception {
try {
- if (LOG.isDebugEnabled()) {
+ 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);
- LOG.debug(sb.toString());
+ logger.debug(sb.toString());
}
failures.incrementAndGet();
@@ -114,8 +114,8 @@ public class TaskManager {
receipt.setErrorCode(code);
receipt.setErrorMessage(message);
this.saveReceipt(notification, new SimpleEntityRef(Device.ENTITY_TYPE, deviceUUID), receipt,true);
- if (LOG.isDebugEnabled()) {
- LOG.debug("notification {} receipt saved for device {}", notification.getUuid(), deviceUUID);
+ if (logger.isDebugEnabled()) {
+ logger.debug("notification {} receipt saved for device {}", notification.getUuid(), deviceUUID);
}
} finally {
completed(notifier, deviceUUID);
@@ -158,12 +158,15 @@ public class TaskManager {
finishedBatch(true,false);
}
public void finishedBatch(boolean fetch, boolean force) throws Exception {
+
if (notification.getDebug() || getFailures() > 0 || force) {
long successes = this.successes.get(); //reset counters
long failures = this.failures.get(); //reset counters
+
for (int i = 0; i < successes; i++) {
this.successes.decrementAndGet();
}
+
for (int i = 0; i < failures; i++) {
this.failures.decrementAndGet();
}
@@ -191,7 +194,7 @@ public class TaskManager {
notification.addProperties(properties);
long latency = notification.getFinished() - notification.getStarted();
- LOG.info("notification finished batch: {} of {} devices in " + latency + "ms", notification.getUuid(), totals);
+ logger.info("notification finished batch: {} of {} devices in " + latency + "ms", notification.getUuid(), totals);
em.update(notification);
// Set<Notifier> notifiers = new HashSet<>(proxy.getAdapterMap().values()); // remove dups
[5/7] usergrid git commit: Merge branch 'master' of
git://git.apache.org/usergrid into USERGRID-1195
Posted by mr...@apache.org.
Merge branch 'master' of git://git.apache.org/usergrid into USERGRID-1195
Conflicts:
stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/000e1ced
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/000e1ced
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/000e1ced
Branch: refs/heads/master
Commit: 000e1ced3180c2ca2c79efa2756480addc8bc457
Parents: bc33c88 d6f597a
Author: Jeff West <jw...@apigee.com>
Authored: Thu Jan 7 16:45:31 2016 -0800
Committer: Jeff West <jw...@apigee.com>
Committed: Thu Jan 7 16:45:31 2016 -0800
----------------------------------------------------------------------
sdks/nodejs/lib/usergrid.js | 4 +-
.../persistence/entities/Notification.java | 167 +++++++++-----
.../usergrid/persistence/entities/Notifier.java | 51 +++--
.../persistence/queue/LocalQueueManager.java | 5 +
stack/pom.xml | 5 +-
.../organizations/users/UsersResource.java | 2 +-
.../rest/management/users/UsersResource.java | 2 +-
.../organizations/OrganizationsResource.java | 4 +-
.../rest/system/ApplicationsResource.java | 4 +-
.../usergrid/rest/system/IndexResource.java | 2 +-
.../usergrid/rest/system/MigrateResource.java | 2 +-
.../rest/test/RefreshIndexResource.java | 2 +-
.../rest/management/OrganizationsIT.java | 61 +++++
stack/services/pom.xml | 3 +-
.../cassandra/ManagementServiceImpl.java | 9 +
.../notifications/NotificationsService.java | 24 +-
.../services/notifications/ProviderAdapter.java | 5 +-
.../services/notifications/QueueListener.java | 14 +-
.../services/notifications/TestAdapter.java | 6 +-
.../notifications/apns/APNsAdapter.java | 9 +-
.../services/notifications/gcm/GCMAdapter.java | 93 ++++++--
.../impl/ApplicationQueueManagerImpl.java | 2 +-
.../services/notifications/wns/WNSAdapter.java | 3 +-
.../AbstractServiceNotificationIT.java | 2 +-
.../apns/MockSuccessfulProviderAdapter.java | 4 +-
.../apns/NotificationsServiceIT.java | 22 +-
.../gcm/MockSuccessfulProviderAdapter.java | 7 +-
.../gcm/NotificationsServiceIT.java | 229 +++++++++++++++----
.../notifications/wns/WNSAdapterTest.java | 5 -
29 files changed, 529 insertions(+), 219 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/000e1ced/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/000e1ced/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
index e7d36e2,8ce4e17..1ab1db1
--- 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
@@@ -113,33 -113,38 +113,39 @@@ public class QueueListener
pool = Executors.newFixedThreadPool(maxThreads);
while (threadCount++ < maxThreads) {
- LOG.info("QueueListener: Starting thread {}.", threadCount);
+ logger.info("QueueListener: Starting thread {}.", threadCount);
+ final int threadNumber = threadCount;
Runnable task = new Runnable() {
@Override
public void run() {
try {
- execute();
+ execute(threadNumber);
} catch (Exception e) {
- logger.error("failed to start push", e);
++
+ if(pool.isShutdown()){
- LOG.warn("QueueListener: push listener pool already shut down.");
++ logger.warn("QueueListener: push listener pool already shut down.");
+ }else{
- LOG.error("QueueListener: threads interrupted", e);
++ logger.error("QueueListener: threads interrupted", e);
+ }
}
}
};
futures.add( pool.submit(task));
}
} catch (Exception e) {
- LOG.error("QueueListener: failed to start", e);
+ logger.error("QueueListener: failed to start:", e);
}
- LOG.info("QueueListener: done starting.");
+ logger.info("QueueListener: done starting.");
}
- private void execute(){
+ private void execute(int threadNumber){
if(Thread.currentThread().isDaemon()) {
Thread.currentThread().setDaemon(true);
}
- Thread.currentThread().setName("Notifications_Processor"+UUID.randomUUID());
+ Thread.currentThread().setName(getClass().getSimpleName()+"_PushNotifications-"+threadNumber);
final AtomicInteger consecutiveExceptions = new AtomicInteger();
- LOG.info("QueueListener: Starting execute process.");
+ logger.info("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());
http://git-wip-us.apache.org/repos/asf/usergrid/blob/000e1ced/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 35dcd5c,7da6e03..22b7d51
--- 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
@@@ -90,9 -90,9 +90,9 @@@ public class ApplicationQueueManagerImp
return;
}
- LOG.info("notification {} start queuing", notification.getUuid());
+ logger.info("notification {} start queuing", notification.getUuid());
- final PathQuery<Device> pathQuery = notification.getPathTokens().getPathQuery() ; //devices query
+ final PathQuery<Device> pathQuery = notification.getPathQuery().buildPathQuery() ; //devices query
final AtomicInteger deviceCount = new AtomicInteger(); //count devices so you can make a judgement on batching
final ConcurrentLinkedQueue<String> errorMessages = new ConcurrentLinkedQueue<String>(); //build up list of issues
http://git-wip-us.apache.org/repos/asf/usergrid/blob/000e1ced/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
----------------------------------------------------------------------
[3/7] usergrid git commit: changed LOG and log to logger for
standardizing logging
Posted by mr...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/EntityDictionaryIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/EntityDictionaryIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/EntityDictionaryIT.java
index 6af35d7..555716a 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/EntityDictionaryIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/EntityDictionaryIT.java
@@ -21,17 +21,13 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
-import java.util.UUID;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.commons.lang3.RandomStringUtils;
-
import org.apache.usergrid.AbstractCoreIT;
import org.apache.usergrid.persistence.entities.Application;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import org.apache.usergrid.utils.JsonUtils;
import static org.junit.Assert.assertArrayEquals;
@@ -43,7 +39,7 @@ import static org.junit.Assert.assertTrue;
public class EntityDictionaryIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( EntityDictionaryIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( EntityDictionaryIT.class );
public EntityDictionaryIT() {
@@ -62,7 +58,7 @@ public class EntityDictionaryIT extends AbstractCoreIT {
provider.setAccessTokenEndpointUrl( "https://accounts.google.com/o/oauth2/token" );
provider.setVersion( "2.0" );
- LOG.info( "EntityDictionaryIT.testApplicationDictionaries" );
+ logger.info( "EntityDictionaryIT.testApplicationDictionaries" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -70,13 +66,13 @@ public class EntityDictionaryIT extends AbstractCoreIT {
em.addToDictionary( em.getApplicationRef(), "oauthproviders", "google", provider );
Object o = em.getDictionaryElementValue( em.getApplicationRef(), "oauthproviders", "google" );
- LOG.info( JsonUtils.mapToFormattedJsonString( o ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( o ) );
}
@Test
public void testUserDictionaries() throws Exception {
- LOG.info( "EntityDictionaryIT.testUserDictionaries" );
+ logger.info( "EntityDictionaryIT.testUserDictionaries" );
@@ -101,7 +97,7 @@ public class EntityDictionaryIT extends AbstractCoreIT {
em.addToDictionary( user, "credentials", "plaintext", credentials );
Object o = em.getDictionaryElementValue( user, "credentials", "plaintext" );
- LOG.info( JsonUtils.mapToFormattedJsonString( o ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( o ) );
assertEquals( CredentialsInfo.class, o.getClass() );
@@ -123,7 +119,7 @@ public class EntityDictionaryIT extends AbstractCoreIT {
em.addToDictionary( user, "credentials", "encrypted", credentials );
o = em.getDictionaryElementValue( user, "credentials", "encrypted" );
- LOG.info( JsonUtils.mapToFormattedJsonString( o ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( o ) );
assertEquals( CredentialsInfo.class, o.getClass() );
returned = ( CredentialsInfo ) o;
@@ -137,7 +133,7 @@ public class EntityDictionaryIT extends AbstractCoreIT {
@Test
public void testRemoveFromDictionary() throws Exception {
- LOG.info( "EntityDictionaryIT.testRemoveFromDictionary" );
+ logger.info( "EntityDictionaryIT.testRemoveFromDictionary" );
Application.OAuthProvider provider = new Application.OAuthProvider();
provider.setClientId( "123456789012.apps.googleusercontent.com" );
@@ -148,7 +144,7 @@ public class EntityDictionaryIT extends AbstractCoreIT {
provider.setAccessTokenEndpointUrl( "https://accounts.google.com/o/oauth2/token" );
provider.setVersion( "2.0" );
- LOG.info( "EntityDictionaryIT.testApplicationDictionaries" );
+ logger.info( "EntityDictionaryIT.testApplicationDictionaries" );
EntityManager em = app.getEntityManager();
@@ -170,7 +166,7 @@ public class EntityDictionaryIT extends AbstractCoreIT {
@Test
public void testGetDictionaries() throws Exception {
- LOG.info( "EntityDictionaryIT.testGetDictionaries" );
+ logger.info( "EntityDictionaryIT.testGetDictionaries" );
Application.OAuthProvider provider = new Application.OAuthProvider();
@@ -197,7 +193,7 @@ public class EntityDictionaryIT extends AbstractCoreIT {
}
@Test
public void testAddMapToDictionaries() throws Exception {
- LOG.info( "EntityDictionaryIT.testAddMapToDictionaries" );
+ logger.info( "EntityDictionaryIT.testAddMapToDictionaries" );
Map<String,Object> testMap = new HashMap<String,Object>();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/EntityManagerIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/EntityManagerIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/EntityManagerIT.java
index 658c808..0f257fb 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/EntityManagerIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/EntityManagerIT.java
@@ -46,7 +46,7 @@ import static org.junit.Assert.assertTrue;
public class EntityManagerIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( EntityManagerIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( EntityManagerIT.class );
public EntityManagerIT() {
@@ -56,7 +56,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Test
public void testEntityManager() throws Exception {
- LOG.info( "EntityManagerIT.testEntityManagerTest" );
+ logger.info( "EntityManagerIT.testEntityManagerTest" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -83,8 +83,8 @@ public class EntityManagerIT extends AbstractCoreIT {
assertEquals( "userRef.id not expected value", user.getUuid(), userRef.getUuid() );
assertEquals( "userRef.type not expected value", "user", userRef.getType() );
- LOG.info( "user.username: " + user.getProperty( "username" ) );
- LOG.info( "user.email: " + user.getProperty( "email" ) );
+ logger.info( "user.username: " + user.getProperty( "username" ) );
+ logger.info( "user.email: " + user.getProperty( "email" ) );
final Query query = Query.fromQL( "username = 'edanuff'" );
@@ -96,8 +96,8 @@ public class EntityManagerIT extends AbstractCoreIT {
assertEquals( "user.username not expected value", "edanuff", user.getProperty( "username" ) );
assertEquals( "user.email not expected value", "ed@anuff.com", user.getProperty( "email" ) );
- LOG.info( "user.username: " + user.getProperty( "username" ) );
- LOG.info( "user.email: " + user.getProperty( "email" ) );
+ logger.info( "user.username: " + user.getProperty( "username" ) );
+ logger.info( "user.email: " + user.getProperty( "email" ) );
final Query emailQuery = Query.fromQL( "email = 'ed@anuff.com'" );
@@ -109,14 +109,14 @@ public class EntityManagerIT extends AbstractCoreIT {
assertEquals( "user.username not expected value", "edanuff", user.getProperty( "username" ) );
assertEquals( "user.email not expected value", "ed@anuff.com", user.getProperty( "email" ) );
- LOG.info( "user.username: " + user.getProperty( "username" ) );
- LOG.info( "user.email: " + user.getProperty( "email" ) );
+ logger.info( "user.username: " + user.getProperty( "username" ) );
+ logger.info( "user.email: " + user.getProperty( "email" ) );
}
@Test
public void testCreateAndGet() throws Exception {
- LOG.info( "EntityDaoTest.testCreateAndGet" );
+ logger.info( "EntityDaoTest.testCreateAndGet" );
EntityManager em = app.getEntityManager();
@@ -184,7 +184,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Test
public void testDictionaries() throws Exception {
- LOG.info( "EntityDaoTest.testDictionaries" );
+ logger.info( "EntityDaoTest.testDictionaries" );
EntityManager em = app.getEntityManager();
@@ -201,9 +201,9 @@ public class EntityManagerIT extends AbstractCoreIT {
assertEquals( "Wrong number of items in list", 3, set.size() );
Iterator<Object> i = set.iterator();
- LOG.info( "first item is " + i.next() );
- LOG.info( "second item is " + i.next() );
- LOG.info( "third item is " + i.next() );
+ logger.info( "first item is " + i.next() );
+ logger.info( "second item is " + i.next() );
+ logger.info( "third item is " + i.next() );
i = set.iterator();
assertEquals( "first item should be alpha", "alpha", i.next() );
@@ -225,7 +225,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Test
public void testProperties() throws Exception {
- LOG.info( "EntityDaoTest.testProperties" );
+ logger.info( "EntityDaoTest.testProperties" );
EntityManager em = app.getEntityManager();
@@ -248,7 +248,7 @@ public class EntityManagerIT extends AbstractCoreIT {
assertEquals( "wrong value for property gamma", ( long ) 3, props.get( "gamma" ) );
for ( Entry<String, Object> entry : props.entrySet() ) {
- LOG.info( entry.getKey() + " : " + entry.getValue() );
+ logger.info( entry.getKey() + " : " + entry.getValue() );
}
em.deleteProperty( entity, "alpha" );
@@ -261,7 +261,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Test
public void testCreateAndDelete() throws Exception {
- LOG.info( "EntityDaoTest.testCreateAndDelete" );
+ logger.info( "EntityDaoTest.testCreateAndDelete" );
EntityManager em = app.getEntityManager();
String name = "test.thing" + UUIDUtils.newTimeUUID();
@@ -270,15 +270,15 @@ public class EntityManagerIT extends AbstractCoreIT {
properties.put( "name", name );
properties.put( "foo", "bar" );
- LOG.info( "Starting entity create" );
+ logger.info( "Starting entity create" );
Entity thing = em.create( "thing", properties );
- LOG.info( "Entity created" );
+ logger.info( "Entity created" );
app.refreshIndex();
- LOG.info( "Starting entity delete" );
+ logger.info( "Starting entity delete" );
em.delete( thing );
- LOG.info( "Entity deleted" );
+ logger.info( "Entity deleted" );
app.refreshIndex();
@@ -296,7 +296,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Test
public void testCreateAndDeleteUser() throws Exception {
- LOG.info( "EntityDaoTest.testCreateAndDeleteUser" );
+ logger.info( "EntityDaoTest.testCreateAndDeleteUser" );
EntityManager em = app.getEntityManager();
@@ -306,15 +306,15 @@ public class EntityManagerIT extends AbstractCoreIT {
properties.put( "username", name );
properties.put( "foo", "bar" );
- LOG.info( "Starting entity create" );
+ logger.info( "Starting entity create" );
Entity user = em.create( "user", properties );
- LOG.info( "Entity created" );
+ logger.info( "Entity created" );
app.refreshIndex();
- LOG.info( "Starting entity delete" );
+ logger.info( "Starting entity delete" );
em.delete( user );
- LOG.info( "Entity deleted" );
+ logger.info( "Entity deleted" );
app.refreshIndex();
@@ -331,9 +331,9 @@ public class EntityManagerIT extends AbstractCoreIT {
properties.put( "username", name );
properties.put( "foo", "bar" );
- LOG.info( "Starting entity create" );
+ logger.info( "Starting entity create" );
user = em.create( "user", properties );
- LOG.info( "Entity created" );
+ logger.info( "Entity created" );
app.refreshIndex();
@@ -350,7 +350,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@SuppressWarnings( "unchecked" )
@Test
public void testJson() throws Exception {
- LOG.info( "EntityDaoTest.testProperties" );
+ logger.info( "EntityDaoTest.testProperties" );
EntityManager em = app.getEntityManager();
@@ -384,7 +384,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Ignore( "Pending https://issues.apache.org/jira/browse/USERGRID-1753. Concurrency issue.")
// There is a concurrency issue due to counters not being thread safe
public void testEntityCounters() throws Exception {
- LOG.info( "EntityManagerIT#testEntityCounters" );
+ logger.info( "EntityManagerIT#testEntityCounters" );
EntityManager em = app.getEntityManager();
Group organizationEntity = new Group();
@@ -411,7 +411,7 @@ public class EntityManagerIT extends AbstractCoreIT {
em = setup.getEmf().getEntityManager( setup.getEmf().getManagementAppId() );
Map<String, Long> counts = em.getEntityCounters( setup.getEmf().getManagementAppId() );
- LOG.info( "Entity counters: {}", counts );
+ logger.info( "Entity counters: {}", counts );
assertNotNull( counts );
assertEquals( 4, counts.size() );
@@ -420,7 +420,7 @@ public class EntityManagerIT extends AbstractCoreIT {
em = setup.getEmf().getEntityManager( applicationId );
counts = em.getEntityCounters( applicationId );
- LOG.info( "Entity counters: {}", counts );
+ logger.info( "Entity counters: {}", counts );
assertNotNull( counts );
assertEquals( 3, counts.size() );
}
@@ -428,7 +428,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Test
public void testCreateAndList() throws Exception {
- LOG.info( "EntityDaoTest.testCreateAndDelete" );
+ logger.info( "EntityDaoTest.testCreateAndDelete" );
EntityManager em = app.getEntityManager();
@@ -438,9 +438,9 @@ public class EntityManagerIT extends AbstractCoreIT {
properties.put( "name", name );
properties.put( "foo", "bar" );
- LOG.info( "Starting entity create" );
+ logger.info( "Starting entity create" );
Entity thing1 = em.create( "thing", properties );
- LOG.info( "Entity created" );
+ logger.info( "Entity created" );
String name2 = "test.thing" + UUIDUtils.newTimeUUID() + 2;
@@ -448,9 +448,9 @@ public class EntityManagerIT extends AbstractCoreIT {
properties.put( "name", name2 );
properties.put( "foo", "bar" );
- LOG.info( "Starting entity create" );
+ logger.info( "Starting entity create" );
Entity thing2 = em.create( "thing", properties );
- LOG.info( "Entity created" );
+ logger.info( "Entity created" );
// now search by username, no results should be returned
@@ -492,7 +492,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Test
public void testImmutableForcedPropChange() throws Exception {
- LOG.info( "EntityDaoTest.testProperties" );
+ logger.info( "EntityDaoTest.testProperties" );
EntityManager em = app.getEntityManager();
@@ -569,7 +569,7 @@ public class EntityManagerIT extends AbstractCoreIT {
@Test
public void testDeprecatedGet() throws Exception {
- LOG.info( "EntityManagerIT.testDeprecatedGet" );
+ logger.info( "EntityManagerIT.testDeprecatedGet" );
EntityManager em = app.getEntityManager();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java
index ae09f97..0b15e09 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoIT.java
@@ -28,7 +28,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.usergrid.AbstractCoreIT;
-import org.apache.usergrid.persistence.model.field.value.Location;
import org.apache.usergrid.utils.MapUtils;
import static org.junit.Assert.assertEquals;
@@ -37,7 +36,7 @@ import static org.junit.Assert.assertTrue;
public class GeoIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger(GeoIT.class);
+ private static final Logger logger = LoggerFactory.getLogger(GeoIT.class);
int NEARBY_RADIUS = 10000;
int CIRCUMFERENCE_OF_THE_EARTH = 40000000;
@@ -125,7 +124,7 @@ public class GeoIT extends AbstractCoreIT {
*/
@Test
public void testMovingTarget() throws Exception {
- LOG.info("GeoIT.testMovingTarget");
+ logger.info("GeoIT.testMovingTarget");
//Get the EntityManager instance
EntityManager em = app.getEntityManager();
assertNotNull(em);
@@ -171,7 +170,7 @@ public class GeoIT extends AbstractCoreIT {
*/
@Test
public void validateDistanceQueryExists() throws Exception {
- LOG.info("GeoIT.validateDistanceQueryExists");
+ logger.info("GeoIT.validateDistanceQueryExists");
//Get the EntityManager instance
EntityManager em = app.getEntityManager();
assertNotNull(em);
@@ -277,7 +276,7 @@ public class GeoIT extends AbstractCoreIT {
for (Map<String, Object> location : LOCATION_PROPERTIES) {
Entity entity = em.create("store", location);
assertNotNull(entity);
- LOG.debug("Entity {} created", entity.getProperty("name"));
+ logger.debug("Entity {} created", entity.getProperty("name"));
}
app.refreshIndex();
//2. validate the size of the result
@@ -318,7 +317,7 @@ public class GeoIT extends AbstractCoreIT {
for (Map<String, Object> location : locations) {
Entity entity = em.create("store", location);
assertNotNull(entity);
- LOG.debug("Entity {} created", entity.getProperty("name"));
+ logger.debug("Entity {} created", entity.getProperty("name"));
}
app.refreshIndex();
//2. validate the size of the result
@@ -389,7 +388,7 @@ public class GeoIT extends AbstractCoreIT {
* circumference of the earth
*/
public void testGeoFromNearbyLocation() throws Exception {
- LOG.info( "GeoIT.testGeoFromNearbyLocation" );
+ logger.info( "GeoIT.testGeoFromNearbyLocation" );
//1. create entities with geo
EntityManager em = loadGeolocationTestEntities();
@@ -426,7 +425,7 @@ public class GeoIT extends AbstractCoreIT {
*/
@Test
public void testGeoFromMultipleLocations() throws Exception {
- LOG.info("GeoIT.testGeoFromMultipleLocations");
+ logger.info("GeoIT.testGeoFromMultipleLocations");
//1 Create entities with geo
EntityManager em = loadGeolocationTestEntities();
//2 Create a list of points from different geographic areas
@@ -767,7 +766,7 @@ public class GeoIT extends AbstractCoreIT {
long endTime = System.currentTimeMillis();
- LOG.info("Runtime took {} milliseconds to search", endTime - startTime);
+ logger.info("Runtime took {} milliseconds to search", endTime - startTime);
}
@@ -779,14 +778,14 @@ public class GeoIT extends AbstractCoreIT {
* 4. return the entity manager
*/
private EntityManager loadGeolocationTestEntities() throws Exception {
- LOG.info("GeoIT.loadGeolocationTestEntities");
+ logger.info("GeoIT.loadGeolocationTestEntities");
//1. Get an instance of the entity manager
EntityManager em = app.getEntityManager();
assertNotNull(em);
//2. load test entities
for (Map<String, Object> location : LOCATION_PROPERTIES) {
- LOG.info("Create entity with location '{}'", location.get("name"));
+ logger.info("Create entity with location '{}'", location.get("name"));
Entity entity = em.create("store", location);
assertNotNull(entity);
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
index 3c04ce6..9a3f5a6 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
@@ -20,7 +20,6 @@ package org.apache.usergrid.persistence;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.UUID;
import org.junit.Test;
import org.slf4j.Logger;
@@ -35,7 +34,7 @@ import static org.junit.Assert.assertNotNull;
public class GeoQueryBooleanTest extends AbstractCoreIT {
- private static final Logger log = LoggerFactory.getLogger( GeoQueryBooleanTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( GeoQueryBooleanTest.class );
public GeoQueryBooleanTest() {
@@ -46,7 +45,7 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
@Test
public void testGeoQueryWithOr() throws Exception {
- log.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
+ logger.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
EntityManager em = app.getEntityManager();
@@ -110,7 +109,7 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
@Test
public void testGeoQueryWithNot() throws Exception {
- log.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
+ logger.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
EntityManager em = app.getEntityManager();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/IndexIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/IndexIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/IndexIT.java
index 15c6f61..f4aa204 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/IndexIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/IndexIT.java
@@ -17,32 +17,23 @@
package org.apache.usergrid.persistence;
-import java.nio.ByteBuffer;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
-import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.usergrid.AbstractCoreIT;
-import org.apache.usergrid.cassandra.SpringResource;
-import org.apache.usergrid.persistence.cassandra.CassandraService;
import org.apache.usergrid.utils.JsonUtils;
-import org.apache.usergrid.utils.UUIDUtils;
-
-import me.prettyprint.cassandra.serializers.ByteBufferSerializer;
-import me.prettyprint.hector.api.Keyspace;
-import me.prettyprint.hector.api.mutation.Mutator;
import static me.prettyprint.hector.api.factory.HFactory.createMutator;
import static org.junit.Assert.*;
public class IndexIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( IndexIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( IndexIT.class );
public static final String[] alphabet = {
"Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India",
@@ -53,7 +44,7 @@ public class IndexIT extends AbstractCoreIT {
@Test
public void testCollectionOrdering() throws Exception {
- LOG.info( "testCollectionOrdering" );
+ logger.info( "testCollectionOrdering" );
UUID applicationId = app.getId();
@@ -106,7 +97,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "order by name desc" ).withCursor(r.getCursor());
r = em.searchCollection( em.getApplicationRef(), "items", query );
- // LOG.info(JsonUtils.mapToFormattedJsonString(r.getEntities()));
+ // logger.info(JsonUtils.mapToFormattedJsonString(r.getEntities()));
for ( Entity entity : r.getEntities() ) {
i--;
assertEquals( alphabet[i], entity.getProperty( "name" ) );
@@ -125,7 +116,7 @@ public class IndexIT extends AbstractCoreIT {
@Test
public void testCollectionFilters() throws Exception {
- LOG.info( "testCollectionFilters" );
+ logger.info( "testCollectionFilters" );
UUID applicationId = app.getId();
assertNotNull( applicationId );
@@ -145,7 +136,7 @@ public class IndexIT extends AbstractCoreIT {
Query query = Query.fromQL( "name < 'delta' order by name asc" );
Results r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
int i = 0;
for ( Entity entity : r.getEntities() ) {
assertEquals( alphabet[i], entity.getProperty( "name" ) );
@@ -155,7 +146,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name <= 'delta' order by name asc" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
i = 0;
for ( Entity entity : r.getEntities() ) {
assertEquals( alphabet[i], entity.getProperty( "name" ) );
@@ -165,7 +156,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name <= 'foxtrot' and name > 'bravo' order by name asc" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
i = 2;
for ( Entity entity : r.getEntities() ) {
assertEquals( alphabet[i], entity.getProperty( "name" ) );
@@ -175,7 +166,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name < 'foxtrot' and name > 'bravo' order by name asc" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
i = 2;
for ( Entity entity : r.getEntities() ) {
assertEquals( alphabet[i], entity.getProperty( "name" ) );
@@ -185,7 +176,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name < 'foxtrot' and name >= 'bravo' order by name asc" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
i = 1;
for ( Entity entity : r.getEntities() ) {
assertEquals( alphabet[i], entity.getProperty( "name" ) );
@@ -195,7 +186,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name <= 'foxtrot' and name >= 'bravo' order by name asc" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
i = 1;
for ( Entity entity : r.getEntities() ) {
assertEquals( alphabet[i], entity.getProperty( "name" ) );
@@ -205,7 +196,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name <= 'foxtrot' and name >= 'bravo' order by name desc" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
i = 6;
for ( Entity entity : r.getEntities() ) {
i--;
@@ -215,7 +206,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name < 'foxtrot' and name > 'bravo' order by name desc" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
i = 5;
for ( Entity entity : r.getEntities() ) {
i--;
@@ -225,7 +216,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name < 'foxtrot' and name >= 'bravo' order by name desc" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
i = 5;
for ( Entity entity : r.getEntities() ) {
i--;
@@ -235,7 +226,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "name = 'foxtrot'" );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( 1, r.size() );
long created = r.getEntity().getCreated();
@@ -243,7 +234,7 @@ public class IndexIT extends AbstractCoreIT {
query = Query.fromQL( "created = " + created );
r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( 1, r.size() );
assertEquals( entityId, r.getEntity().getUuid() );
}
@@ -251,7 +242,7 @@ public class IndexIT extends AbstractCoreIT {
@Test
public void testSecondarySorts() throws Exception {
- LOG.info( "testSecondarySorts" );
+ logger.info( "testSecondarySorts" );
UUID applicationId = app.getId();
assertNotNull( applicationId );
@@ -273,7 +264,7 @@ public class IndexIT extends AbstractCoreIT {
Query query = Query.fromQL( "group = 1 order by name desc" );
Results r = em.searchCollection( em.getApplicationRef(), "items", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
int i = 6;
for ( Entity entity : r.getEntities() ) {
i--;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/SchemaTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/SchemaTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/SchemaTest.java
index 68c19d2..b2f0be8 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/SchemaTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/SchemaTest.java
@@ -33,16 +33,16 @@ import static org.junit.Assert.assertTrue;
public class SchemaTest {
- private static final Logger LOG = LoggerFactory.getLogger( SchemaTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( SchemaTest.class );
@Test
public void testTypes() throws Exception {
- LOG.info( "" + Schema.getDefaultSchema().getEntityClass( "sample_entity" ) );
- LOG.info( "" + Schema.getDefaultSchema().getEntityType( SampleEntity.class ) );
+ logger.info( "" + Schema.getDefaultSchema().getEntityClass( "sample_entity" ) );
+ logger.info( "" + Schema.getDefaultSchema().getEntityType( SampleEntity.class ) );
SampleEntity entity = new SampleEntity();
- LOG.info( entity.getType() );
+ logger.info( entity.getType() );
}
@@ -55,14 +55,14 @@ public class SchemaTest {
List<String> entitiesPackage = schema.getEntitiesPackage();
for ( String entityPackage : entitiesPackage ) {
- LOG.info( entityPackage );
+ logger.info( entityPackage );
}
Assert.assertEquals( schema.getEntityClass( "simple" ), Simple.class );
Assert.assertEquals( schema.getEntityType( Simple.class ), "simple" );
Simple entity = new Simple();
- LOG.info( entity.getType() );
+ logger.info( entity.getType() );
}
@@ -76,7 +76,7 @@ public class SchemaTest {
public void dumpSetNames( String entityType ) {
- LOG.info( entityType + " entity has the following sets: " + Schema.getDefaultSchema()
+ logger.info( entityType + " entity has the following sets: " + Schema.getDefaultSchema()
.getDictionaryNames( entityType ) );
}
@@ -84,9 +84,9 @@ public class SchemaTest {
@Test
public void testJsonSchema() throws Exception {
- LOG.info( mapToFormattedJsonString( Schema.getDefaultSchema().getEntityJsonSchema( "user" ) ) );
+ logger.info( mapToFormattedJsonString( Schema.getDefaultSchema().getEntityJsonSchema( "user" ) ) );
- LOG.info( mapToFormattedJsonString( Schema.getDefaultSchema().getEntityJsonSchema( "test" ) ) );
+ logger.info( mapToFormattedJsonString( Schema.getDefaultSchema().getEntityJsonSchema( "test" ) ) );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionTransitivePagingIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionTransitivePagingIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionTransitivePagingIT.java
index aee643b..cea3b35 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionTransitivePagingIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionTransitivePagingIT.java
@@ -43,7 +43,7 @@ import static org.junit.Assert.assertEquals;
*/
public class IntersectionTransitivePagingIT{
- private static final Logger LOG = LoggerFactory.getLogger( IntersectionTransitivePagingIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( IntersectionTransitivePagingIT.class );
private static final String union = "select * where city = 'San Francisco' AND postalCode = 94100";
private static final String unionReverse = "select * where postalCode = 94100 AND city = 'San Francisco'";
@@ -171,7 +171,7 @@ public class IntersectionTransitivePagingIT{
long stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, expectedResults.size() );
+ logger.info( "Query took {} ms to return {} entities", stop - start, expectedResults.size() );
assertEquals( "All names returned", expectedResults.size(), currentExpectedIndex );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java
index 9ab8c78..4d60164 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IntersectionUnionPagingIT.java
@@ -45,7 +45,7 @@ import static org.junit.Assert.assertTrue;
*/
public class IntersectionUnionPagingIT {
- private static final Logger LOG = LoggerFactory.getLogger( IntersectionUnionPagingIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( IntersectionUnionPagingIT.class );
private static final String unionScan =
"select * where (field1Or > '00000000' OR field2Or > '00000000') AND fieldDate = '0000-00-00'";
@@ -97,7 +97,7 @@ public class IntersectionUnionPagingIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
final String zeros = String.format( "%08d", 0 );
@@ -129,8 +129,8 @@ public class IntersectionUnionPagingIT {
Entity saved = io.writeEntity( entity );
- if (LOG.isDebugEnabled()) {
- LOG.debug("Writing entity with id '{}'", saved.getUuid());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Writing entity with id '{}'", saved.getUuid());
}
}
@@ -138,7 +138,7 @@ public class IntersectionUnionPagingIT {
app.refreshIndex();
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
return Collections.unmodifiableSet( names );
}
@@ -178,7 +178,7 @@ public class IntersectionUnionPagingIT {
long stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, expectedResults.size() );
+ logger.info( "Query took {} ms to return {} entities", stop - start, expectedResults.size() );
assertEquals( "All names returned", 0, newSets.size() );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
index 3ff48b6..b2003fe 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
@@ -45,7 +45,7 @@ import static org.junit.Assert.assertTrue;
/** @author tnine */
public class IteratingQueryIT {
- private static final Logger LOG = LoggerFactory.getLogger( IteratingQueryIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( IteratingQueryIT.class );
@ClassRule
public static CoreITSetup setup = new CoreITSetupImpl( );
@@ -288,7 +288,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
for ( int i = 0; i < size; i++ ) {
Map<String, Object> entity = new HashMap<String, Object>();
@@ -302,7 +302,7 @@ public class IteratingQueryIT {
Thread.sleep(1000);
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL("order by created" );
query.setLimit( queryLimit );
@@ -328,7 +328,7 @@ public class IteratingQueryIT {
while ( results.getCursor() != null );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( size, count );
}
@@ -348,7 +348,7 @@ public class IteratingQueryIT {
List<String> expected = new ArrayList<String>( size / intersectIncrement );
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
for ( int i = 0; i < size; i++ ) {
Map<String, Object> entity = new HashMap<String, Object>();
@@ -371,7 +371,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where intersect = true order by created asc" );
query.setLimit( queryLimit );
@@ -397,7 +397,7 @@ public class IteratingQueryIT {
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( expected.size(), count );
}
@@ -416,7 +416,7 @@ public class IteratingQueryIT {
io.doSetup();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expectedResults = new ArrayList<String>( size / secondIncrement );
@@ -441,7 +441,7 @@ public class IteratingQueryIT {
this.app.refreshIndex();
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where intersect = true AND intersect2 = true order by created" );
query.setLimit( queryLimit );
@@ -468,7 +468,7 @@ public class IteratingQueryIT {
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( expectedResults.size(), count );
}
@@ -485,7 +485,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
for ( int i = 0; i < size; i++ ) {
Map<String, Object> entity = new HashMap<String, Object>();
@@ -498,7 +498,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where intersect = true AND intersect2 = true order by created" );
query.setLimit( queryLimit );
@@ -511,7 +511,7 @@ public class IteratingQueryIT {
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, 0 );
+ logger.info( "Query took {} ms to return {} entities", stop - start, 0 );
assertEquals( 0, results.size() );
}
@@ -530,7 +530,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expectedResults = new ArrayList<String>( size / secondIncrement );
@@ -555,7 +555,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where intersect = true OR intersect2 = true order by created" );
query.setLimit( queryLimit );
@@ -582,7 +582,7 @@ public class IteratingQueryIT {
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( expectedResults.size(), count );
}
@@ -601,7 +601,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expectedResults = new ArrayList<String>( size / secondIncrement );
@@ -626,7 +626,7 @@ public class IteratingQueryIT {
app.refreshIndex();
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where NOT (intersect = true AND intersect2 = true) order by created" );
query.setLimit( queryLimit );
@@ -653,7 +653,7 @@ public class IteratingQueryIT {
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( expectedResults.size(), count );
}
@@ -670,7 +670,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expected = new ArrayList<String>( matchMax );
@@ -692,7 +692,7 @@ public class IteratingQueryIT {
app.refreshIndex();
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where searched = true order by created" );
query.setLimit( queryLimit );
@@ -712,7 +712,7 @@ public class IteratingQueryIT {
assertTrue( results.getCursor() == null );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( expected.size(), count );
}
@@ -728,7 +728,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expected = new ArrayList<String>( size );
@@ -746,7 +746,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where index >= "+ startValue + " order by index desc" );
query.setLimit( queryLimit );
@@ -775,7 +775,7 @@ public class IteratingQueryIT {
assertEquals( expected.size() - delta, count );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
}
@@ -789,7 +789,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expected = new ArrayList<String>( size );
@@ -807,7 +807,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where index >= "+ startValue + " order by index desc" );
query.setLimit( queryLimit );
@@ -836,7 +836,7 @@ public class IteratingQueryIT {
assertEquals( expected.size() - delta, count );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
}
@@ -850,7 +850,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expected = new ArrayList<String>( size );
@@ -868,7 +868,7 @@ public class IteratingQueryIT {
app.refreshIndex();
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where index >= "+ startValue + " order by index desc" );
query.setLimit( queryLimit );
@@ -896,7 +896,7 @@ public class IteratingQueryIT {
assertEquals( expected.size() - startValue, count );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
}
@@ -910,7 +910,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expected = new ArrayList<String>( size );
@@ -929,7 +929,7 @@ public class IteratingQueryIT {
Thread.sleep(500);
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL( "select * where index >= "+ startValue + " order by index desc" );
query.setLimit( queryLimit );
@@ -957,7 +957,7 @@ public class IteratingQueryIT {
assertEquals( expected.size() - startValue , count );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
}
@@ -972,7 +972,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expected = new ArrayList<String>( size );
@@ -990,7 +990,7 @@ public class IteratingQueryIT {
app.refreshIndex();
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL(
String.format( "select * where index >= %d AND index <= %d order by index desc", startValue,
@@ -1021,7 +1021,7 @@ public class IteratingQueryIT {
assertEquals( expected.size() - startValue - delta +1 , count );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
}
@@ -1036,7 +1036,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<String> expected = new ArrayList<String>( size );
@@ -1054,7 +1054,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL(
String.format( "select * where index >= %d AND index <= %d order by index asc", startValue,
@@ -1085,7 +1085,7 @@ public class IteratingQueryIT {
assertEquals( expected.size() - startValue - delta + 1, count );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
}
@@ -1102,7 +1102,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
for ( int i = 0; i < size; i++ ) {
Map<String, Object> entity = new HashMap<String, Object>();
@@ -1114,7 +1114,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info("Writes took {} ms", stop - start );
+ logger.info("Writes took {} ms", stop - start );
Query query = new Query();
@@ -1141,7 +1141,7 @@ public class IteratingQueryIT {
while ( results.getCursor() != null );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( size, count );
}
@@ -1188,7 +1188,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
for ( int i = 0; i < size; i++ ) {
Map<String, Object> entity = new HashMap<String, Object>();
@@ -1214,7 +1214,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
app.refreshIndex();
@@ -1248,7 +1248,7 @@ public class IteratingQueryIT {
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( sortedResults.size(), count );
}
@@ -1267,7 +1267,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
Set<Entity> sortedResults = new TreeSet<Entity>( new Comparator<Entity>() {
@@ -1320,7 +1320,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
app.refreshIndex();
@@ -1352,7 +1352,7 @@ public class IteratingQueryIT {
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( sortedResults.size(), count );
}
@@ -1374,7 +1374,7 @@ public class IteratingQueryIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
for ( int i = 0; i < size; i++ ) {
Map<String, Object> entity = new HashMap<String, Object>();
@@ -1388,7 +1388,7 @@ public class IteratingQueryIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
Query query = Query.fromQL("select * where NOT boolean = false order by index asc");
query.setLimit( 2 );
@@ -1416,7 +1416,7 @@ public class IteratingQueryIT {
while ( results.getCursor() != null );
stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, count );
+ logger.info( "Query took {} ms to return {} entities", stop - start, count );
assertEquals( size/2, count );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/query/NotSubPropertyIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/NotSubPropertyIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/NotSubPropertyIT.java
index 4208a85..f7308da 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/NotSubPropertyIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/query/NotSubPropertyIT.java
@@ -44,7 +44,7 @@ import static org.junit.Assert.assertEquals;
public class NotSubPropertyIT {
- private static final Logger LOG = LoggerFactory.getLogger( IntersectionUnionPagingIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( IntersectionUnionPagingIT.class );
private static final String notQuery = "select * where NOT subArray.usageType = 'true' order by created asc";
@@ -93,7 +93,7 @@ public class NotSubPropertyIT {
long start = System.currentTimeMillis();
- LOG.info( "Writing {} entities.", size );
+ logger.info( "Writing {} entities.", size );
List<UUID> expected = new ArrayList<UUID>( size );
@@ -130,7 +130,7 @@ public class NotSubPropertyIT {
long stop = System.currentTimeMillis();
- LOG.info( "Writes took {} ms", stop - start );
+ logger.info( "Writes took {} ms", stop - start );
app.refreshIndex();
@@ -171,7 +171,7 @@ public class NotSubPropertyIT {
long stop = System.currentTimeMillis();
- LOG.info( "Query took {} ms to return {} entities", stop - start, expectedResults.size() );
+ logger.info( "Query took {} ms to return {} entities", stop - start, expectedResults.size() );
assertEquals( "All names returned", expectedResults.size(), expectedIndex );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java b/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java
index c107f20..1758eb9 100644
--- a/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java
@@ -32,7 +32,7 @@ import static org.junit.Assert.assertEquals;
public class IndexUtilsTest {
- private static final Logger LOG = LoggerFactory.getLogger( IndexUtilsTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( IndexUtilsTest.class );
@Test
@@ -45,7 +45,7 @@ public class IndexUtilsTest {
assertEquals( 11, keywords.size() );
for ( String keyword : keywords ) {
- LOG.info( keyword );
+ logger.info( keyword );
}
}
@@ -63,7 +63,7 @@ public class IndexUtilsTest {
List<Entry<String, Object>> l = IndexUtils.getKeyValueList( activity, false );
for ( Entry<String, Object> e : l ) {
- LOG.info( e.getKey() + " = " + e.getValue() );
+ logger.info( e.getKey() + " = " + e.getValue() );
}
assertEquals( 7, l.size() );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/utils/JsonUtilsTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/utils/JsonUtilsTest.java b/stack/core/src/test/java/org/apache/usergrid/utils/JsonUtilsTest.java
index 34461bc..e9eadbb 100644
--- a/stack/core/src/test/java/org/apache/usergrid/utils/JsonUtilsTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/utils/JsonUtilsTest.java
@@ -34,7 +34,7 @@ import static org.junit.Assert.assertEquals;
public class JsonUtilsTest {
- private static final Logger LOG = LoggerFactory.getLogger( JsonUtilsTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( JsonUtilsTest.class );
@SuppressWarnings("unchecked")
@@ -70,7 +70,7 @@ public class JsonUtilsTest {
List<Map.Entry<String, Object>> list = IndexUtils.getKeyValueList( path, json, true );
for ( Map.Entry<String, Object> e : list ) {
- LOG.info( e.getKey() + " = " + e.getValue() );
+ logger.info( e.getKey() + " = " + e.getValue() );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/utils/ListUtilsTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/utils/ListUtilsTest.java b/stack/core/src/test/java/org/apache/usergrid/utils/ListUtilsTest.java
index aa841c6..8f291c3 100644
--- a/stack/core/src/test/java/org/apache/usergrid/utils/ListUtilsTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/utils/ListUtilsTest.java
@@ -29,7 +29,7 @@ import static org.junit.Assert.assertEquals;
public class ListUtilsTest {
- private static final Logger LOG = LoggerFactory.getLogger( ListUtilsTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( ListUtilsTest.class );
@Test
@@ -42,12 +42,12 @@ public class ListUtilsTest {
l = ListUtils.flatten( l );
assertEquals( 9, l.size() );
- LOG.info( JsonUtils.mapToFormattedJsonString( l ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( l ) );
l = Arrays.asList( Arrays.asList( 1, 2, 3 ), 4, 5, 6, Arrays.asList( 7, 8, 9 ) );
l = ListUtils.flatten( l );
assertEquals( 9, l.size() );
- LOG.info( JsonUtils.mapToFormattedJsonString( l ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( l ) );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/utils/MapUtilsTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/utils/MapUtilsTest.java b/stack/core/src/test/java/org/apache/usergrid/utils/MapUtilsTest.java
index a587d4f..24a9e3a 100644
--- a/stack/core/src/test/java/org/apache/usergrid/utils/MapUtilsTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/utils/MapUtilsTest.java
@@ -26,16 +26,16 @@ import org.slf4j.LoggerFactory;
public class MapUtilsTest {
- private static final Logger LOG = LoggerFactory.getLogger( MapUtilsTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( MapUtilsTest.class );
@Test
public void testMapUtils() {
Map<String, ?> map = MapUtils.putPath( "a.b.c", 5 );
- LOG.info( JsonUtils.mapToFormattedJsonString( map ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( map ) );
map = MapUtils.putPath( map, "a.c", 6 );
- LOG.info( JsonUtils.mapToFormattedJsonString( map ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( map ) );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/utils/TestInflector.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/utils/TestInflector.java b/stack/core/src/test/java/org/apache/usergrid/utils/TestInflector.java
index 79d58f1..0499207 100644
--- a/stack/core/src/test/java/org/apache/usergrid/utils/TestInflector.java
+++ b/stack/core/src/test/java/org/apache/usergrid/utils/TestInflector.java
@@ -25,7 +25,7 @@ import static org.junit.Assert.assertEquals;
public class TestInflector {
- private static final Logger LOG = LoggerFactory.getLogger( TestInflector.class );
+ private static final Logger logger = LoggerFactory.getLogger( TestInflector.class );
@Test
@@ -68,14 +68,14 @@ public class TestInflector {
public void testSingularize( String p, String expected ) {
String s = Inflector.getInstance().singularize( p );
- LOG.info( "Inflector says singular form of " + p + " is " + s );
+ logger.info( "Inflector says singular form of " + p + " is " + s );
assertEquals( "singular form of " + p + " not expected value", expected, s );
}
public void testPluralize( String s, String expected ) {
String p = Inflector.getInstance().pluralize( s );
- LOG.info( "Inflector says plural form of " + s + " is " + p );
+ logger.info( "Inflector says plural form of " + s + " is " + p );
assertEquals( "plural form of " + s + " not expected value", expected, p );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerStressTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerStressTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerStressTest.java
index 1aabf75..c919c8f 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerStressTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerStressTest.java
@@ -22,7 +22,6 @@ import java.util.HashSet;
import java.util.Set;
import org.apache.usergrid.StressTest;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -54,7 +53,7 @@ import static org.junit.Assert.assertNotNull;
@UseModules(TestCollectionModule.class)
@Category(StressTest.class)
public class EntityCollectionManagerStressTest {
- private static final Logger log = LoggerFactory.getLogger(
+ private static final Logger logger = LoggerFactory.getLogger(
EntityCollectionManagerStressTest.class );
@Inject
@@ -90,11 +89,11 @@ public class EntityCollectionManagerStressTest {
ids.add(returned.getId());
if ( i % 1000 == 0 ) {
- log.info(" Wrote: " + i);
+ logger.info(" Wrote: " + i);
}
}
timer.stop();
- log.info( "Total time to write {} entries {}ms", limit, timer.getTime());
+ logger.info( "Total time to write {} entries {}ms", limit, timer.getTime());
timer.reset();
timer.start();
@@ -104,6 +103,6 @@ public class EntityCollectionManagerStressTest {
assertNotNull("Returned has a version", entity.getVersion());
}
timer.stop();
- log.info( "Total time to read {} entries {}ms", limit, timer.getTime());
+ logger.info( "Total time to read {} entries {}ms", limit, timer.getTime());
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
index 0ca0649..7133e5a 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
@@ -48,7 +48,7 @@ import static org.junit.Assert.assertTrue;
* Test basic operation of change log
*/
public class ChangeLogGeneratorImplTest {
- private static final Logger LOG = LoggerFactory.getLogger( ChangeLogGeneratorImplTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( ChangeLogGeneratorImplTest.class );
/**
@@ -57,7 +57,7 @@ public class ChangeLogGeneratorImplTest {
@Test
public void testBasicOperation() throws ConnectionException {
- LOG.info( "ChangeLogGeneratorImpl test" );
+ logger.info( "ChangeLogGeneratorImpl test" );
final Id entityId = new SimpleId( "test" );
@@ -117,7 +117,7 @@ public class ChangeLogGeneratorImplTest {
@Test
public void testDeletedVersionFirst() throws ConnectionException {
- LOG.info( "ChangeLogGeneratorImpl test" );
+ logger.info( "ChangeLogGeneratorImpl test" );
final Id entityId = new SimpleId( "test" );
@@ -175,7 +175,7 @@ public class ChangeLogGeneratorImplTest {
@Test
public void testDeletedMiddle() throws ConnectionException {
- LOG.info( "ChangeLogGeneratorImpl test" );
+ logger.info( "ChangeLogGeneratorImpl test" );
final Id entityId = new SimpleId( "test" );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerifyTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerifyTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerifyTest.java
index 1af8867..6a705e4 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerifyTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteOptimisticVerifyTest.java
@@ -58,7 +58,7 @@ import static org.mockito.Mockito.when;
@UseModules( TestCollectionModule.class )
public class WriteOptimisticVerifyTest extends AbstractMvccEntityStageTest {
- private static final Logger log = LoggerFactory.getLogger(WriteOptimisticVerifyTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(WriteOptimisticVerifyTest.class);
@Override
protected void validateStage( final CollectionIoEvent<MvccEntity> event ) {
@@ -150,7 +150,7 @@ public class WriteOptimisticVerifyTest extends AbstractMvccEntityStageTest {
newStage.call( new CollectionIoEvent<>(scope, mvccEntity));
} catch (WriteOptimisticVerifyException e) {
- log.info("Error", e);
+ logger.info("Error", e);
conflictDetected = true;
rollbackAction.call( e );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java
index 9671bc5..63af58d 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/data/AbstractMigrationPlugin.java
@@ -38,7 +38,7 @@ public abstract class AbstractMigrationPlugin implements MigrationPlugin {
- private static final Logger LOG = LoggerFactory.getLogger( AbstractMigrationPlugin.class );
+ private static final Logger logger = LoggerFactory.getLogger( AbstractMigrationPlugin.class );
private final Set<DataMigration> entityDataMigrations;
@@ -57,7 +57,7 @@ public abstract class AbstractMigrationPlugin implements MigrationPlugin {
//run until complete
while(runMigration( observer )){
- LOG.info( "Migration complete, checking for next run" );
+ logger.info( "Migration complete, checking for next run" );
}
}
@@ -102,7 +102,7 @@ public abstract class AbstractMigrationPlugin implements MigrationPlugin {
}
if(migrationToExecute == null){
- LOG.info( "No migrations found to execute" );
+ logger.info( "No migrations found to execute" );
return false;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java
index f693857..8ee7e36 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java
@@ -39,7 +39,7 @@ import com.netflix.astyanax.model.ColumnFamily;
*/
public class TestUtils {
- private static final Logger log = LoggerFactory.getLogger( TestUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( TestUtils.class );
/**
* Create the kespace, ignore exceptions if it already exists
@@ -58,7 +58,7 @@ public class TestUtils {
keyspace.createKeyspace( options );
}
catch ( Throwable t ) {
- log.info( "Error on creating keyspace, ignoring", t );
+ logger.info( "Error on creating keyspace, ignoring", t );
}
@@ -70,7 +70,7 @@ public class TestUtils {
try{
keyspace.createColumnFamily( columnFamily, new HashMap<String, Object>() );
}catch(Exception e){
- log.error( "Error on creating column family, ignoring" , e);
+ logger.error( "Error on creating column family, ignoring" , e);
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java
index da35ec5..23d7eb9 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java
@@ -42,7 +42,7 @@ import static org.junit.Assert.fail;
public class OrderedMergeTest {
- private static final Logger log = LoggerFactory.getLogger( OrderedMergeTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( OrderedMergeTest.class );
@Test
@@ -74,7 +74,7 @@ public class OrderedMergeTest {
@Override
public void onNext( final Integer integer ) {
- log.info( "onNext invoked with {}", integer );
+ logger.info( "onNext invoked with {}", integer );
results.add( integer );
}
} );
@@ -122,14 +122,14 @@ public class OrderedMergeTest {
@Override
public void onError( final Throwable e ) {
- log.error("Test failed due to exception", e);
+ logger.error("Test failed due to exception", e);
fail( "An error was thrown " );
}
@Override
public void onNext( final Integer integer ) {
- log.info( "onNext invoked with {}", integer );
+ logger.info( "onNext invoked with {}", integer );
results.add( integer );
}
} );
@@ -182,7 +182,7 @@ public class OrderedMergeTest {
@Override
public void onError( final Throwable e ) {
- log.error( "Expected error thrown", e );
+ logger.error( "Expected error thrown", e );
if ( e.getMessage().contains( "The maximum queue size of 2 has been reached" ) ) {
errorThrown[0] = true;
@@ -194,7 +194,7 @@ public class OrderedMergeTest {
@Override
public void onNext( final Integer integer ) {
- log.info( "onNext invoked with {}", integer );
+ logger.info( "onNext invoked with {}", integer );
results.add( integer );
}
} );
@@ -250,7 +250,7 @@ public class OrderedMergeTest {
@Override
public void onNext(final Integer integer) {
- log.info("onNext invoked with {}", integer);
+ logger.info("onNext invoked with {}", integer);
results.add(integer);
}
});
@@ -306,7 +306,7 @@ public class OrderedMergeTest {
@Override
public void onError( final Throwable e ) {
- log.error("Expected error thrown", e);
+ logger.error("Expected error thrown", e);
if ( e.getMessage().contains( "The maximum queue size of 2 has been reached" ) ) {
errorThrown[0] = true;
@@ -318,7 +318,7 @@ public class OrderedMergeTest {
@Override
public void onNext( final Integer integer ) {
- log.info("onNext invoked with {}", integer);
+ logger.info("onNext invoked with {}", integer);
}
} );
@@ -373,14 +373,14 @@ public class OrderedMergeTest {
@Override
public void onError( final Throwable e ) {
- log.error("Test failed due to exception", e);
+ logger.error("Test failed due to exception", e);
fail("An error was thrown ");
}
@Override
public void onNext( final Integer integer ) {
- log.info( "onNext invoked with {}", integer );
+ logger.info( "onNext invoked with {}", integer );
results.add(integer);
}
} );
@@ -449,7 +449,7 @@ public class OrderedMergeTest {
@Override
public void onNext( final Integer integer ) {
- log.info( "onNext invoked with {}", integer );
+ logger.info( "onNext invoked with {}", integer );
results.add( integer );
}
} );
@@ -473,10 +473,10 @@ public class OrderedMergeTest {
final AtomicInteger i = new AtomicInteger();
Observable.from(expected).doOnNext(x -> {
- log.info("print " + x);
+ logger.info("print " + x);
i.set(x);
- }).doOnError(e -> log.error(e.getMessage())).subscribe();
- log.info("last");
+ }).doOnError(e -> logger.error(e.getMessage())).subscribe();
+ logger.info("last");
assertTrue(i.get()==0);
}
@@ -487,10 +487,10 @@ public class OrderedMergeTest {
List<Integer> expected = Arrays.asList(10, 9, 9, 8, 7, 6, 6, 5, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0);
Observable.from(expected).doOnNext(x -> {
- log.info("print " + x);
+ logger.info("print " + x);
throw new RuntimeException();
- }).doOnError(e -> log.error(e.getMessage())).subscribe();
- log.info("last");
+ }).doOnError(e -> logger.error(e.getMessage())).subscribe();
+ logger.info("last");
fail();
} catch (Exception e) {
}
@@ -546,7 +546,7 @@ public class OrderedMergeTest {
@Override
public void onNext( final Integer integer ) {
- log.info( "onNext invoked with {}", integer );
+ logger.info( "onNext invoked with {}", integer );
results.add( integer );
}
} );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java
index a87a079..aaa9814 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java
@@ -20,20 +20,14 @@
package org.apache.usergrid.persistence.graph.impl.stage;
-import java.util.Iterator;
import java.util.UUID;
-import com.google.common.base.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.usergrid.persistence.core.rx.ObservableIterator;
import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.graph.Edge;
import org.apache.usergrid.persistence.graph.GraphFig;
import org.apache.usergrid.persistence.graph.MarkedEdge;
-import org.apache.usergrid.persistence.graph.SearchByEdgeType;
-import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdge;
import org.apache.usergrid.persistence.graph.serialization.EdgeSerialization;
import com.google.common.base.Preconditions;
@@ -42,8 +36,6 @@ import com.netflix.astyanax.Keyspace;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
import rx.Observable;
-import rx.functions.Action1;
-import rx.functions.Func1;
/**
@@ -53,7 +45,7 @@ import rx.functions.Func1;
public class EdgeDeleteRepairImpl implements EdgeDeleteRepair {
- private static final Logger LOG = LoggerFactory.getLogger( EdgeDeleteRepairImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( EdgeDeleteRepairImpl.class );
protected final EdgeSerialization storageSerialization;
protected final GraphFig graphFig;
@@ -82,7 +74,7 @@ public class EdgeDeleteRepairImpl implements EdgeDeleteRepair {
return Observable.just( edge ).filter( markedEdge-> markedEdge.isDeleted() )
.doOnNext( markedEdge -> {
//it's still in the same state as it was when we queued it. Remove it
- LOG.info( "Removing edge {} ", markedEdge );
+ logger.info( "Removing edge {} ", markedEdge );
//remove from the commit log
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 8fa8914..116e526 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
@@ -57,7 +57,7 @@ import com.netflix.astyanax.util.TimeUUIDUtils;
public class NodeShardAllocationImpl implements NodeShardAllocation {
- private static final Logger LOG = LoggerFactory.getLogger( NodeShardAllocationImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( NodeShardAllocationImpl.class );
private final EdgeShardSerialization edgeShardSerialization;
private final EdgeColumnFamilies edgeColumnFamilies;
@@ -138,13 +138,13 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
* Nothing to do, it's been created very recently, we don't create a new one
*/
if ( shardEntryGroup.isCompactionPending() ) {
- if (LOG.isTraceEnabled()) LOG.trace( "Shard entry group {} is compacting, not auditing", shardEntryGroup );
+ if (logger.isTraceEnabled()) logger.trace( "Shard entry group {} is compacting, not auditing", shardEntryGroup );
return false;
}
//we can't allocate, we have more than 1 write shard currently. We need to compact first
if ( shardEntryGroup.entrySize() != 1 ) {
- if (LOG.isTraceEnabled()) LOG.trace( "Shard entry group {} does not have 1 entry, not allocating", shardEntryGroup );
+ if (logger.isTraceEnabled()) logger.trace( "Shard entry group {} does not have 1 entry, not allocating", shardEntryGroup );
return false;
}
@@ -158,7 +158,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
if ( shard.getCreatedTime() >= minTime ) {
- if (LOG.isTraceEnabled()) LOG.trace( "Shard entry group {} and shard {} is before the minimum created time of {}. Not allocating.does not have 1 entry, not allocating", shardEntryGroup, shard, minTime );
+ if (logger.isTraceEnabled()) logger.trace( "Shard entry group {} and shard {} is before the minimum created time of {}. Not allocating.does not have 1 entry, not allocating", shardEntryGroup, shard, minTime );
return false;
}
@@ -199,7 +199,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
if ( !edges.hasNext() ) {
- if (LOG.isTraceEnabled()) LOG.trace(
+ 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",
directedEdgeMeta );
return false;
@@ -231,7 +231,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
* Sanity check in case we audit before we have a full shard
*/
if ( marked == null ) {
- if (LOG.isTraceEnabled()) LOG.trace( "Shard {} in shard group {} not full, not splitting", shard, shardEntryGroup );
+ if (logger.isTraceEnabled()) logger.trace( "Shard {} in shard group {} not full, not splitting", shard, shardEntryGroup );
return false;
}
@@ -239,7 +239,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
final Shard newShard = new Shard( marked.getTimestamp(), createTimestamp, false );
- LOG.info( "Allocating new shard {} for edge meta {}", newShard, directedEdgeMeta );
+ logger.info( "Allocating new shard {} for edge meta {}", newShard, directedEdgeMeta );
final MutationBatch batch = this.edgeShardSerialization.writeShardMeta( scope, newShard, directedEdgeMeta );
[6/7] usergrid git commit: Fix incorrect log level in BasicAuth
filter.
Posted by mr...@apache.org.
Fix incorrect log level in BasicAuth filter.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/5034844e
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/5034844e
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/5034844e
Branch: refs/heads/master
Commit: 5034844e5185f983a4cc7a15b6d0d0ffca8acbb1
Parents: d6f597a
Author: Michael Russo <mi...@gmail.com>
Authored: Fri Jan 8 09:19:49 2016 -0800
Committer: Michael Russo <mi...@gmail.com>
Committed: Fri Jan 8 09:19:49 2016 -0800
----------------------------------------------------------------------
.../rest/security/shiro/filters/BasicAuthSecurityFilter.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/5034844e/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 c0e278c..e516f73 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,7 +45,10 @@ public class BasicAuthSecurityFilter extends SecurityFilter {
@Override
public void filter( ContainerRequestContext request ) {
- logger.info("Filtering: " + request.getUriInfo().getBaseUri());
+ if(logger.isDebugEnabled()){
+ logger.debug("Filtering: " + request.getUriInfo().getBaseUri());
+ }
+
Map<String, String> auth_types = getAuthTypes( request );
if ( ( auth_types == null ) || !auth_types.containsKey( AUTH_BASIC_TYPE ) ) {
[4/7] usergrid git commit: changed LOG and log to logger for
standardizing logging
Posted by mr...@apache.org.
changed LOG and log to logger for standardizing logging
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/bc33c88d
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/bc33c88d
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/bc33c88d
Branch: refs/heads/master
Commit: bc33c88ddbed75736f65e36f899b6ad2dfa8fe19
Parents: f9aab91
Author: Jeff West <jw...@apigee.com>
Authored: Thu Jan 7 16:39:44 2016 -0800
Committer: Jeff West <jw...@apigee.com>
Committed: Thu Jan 7 16:39:44 2016 -0800
----------------------------------------------------------------------
.../batch/service/JobSchedulerService.java | 55 +++++----
.../batch/service/SchedulerServiceImpl.java | 30 ++---
.../usergrid/count/Slf4JBatchSubmitter.java | 6 +-
.../org/apache/usergrid/utils/MapUtils.java | 2 +-
.../org/apache/usergrid/utils/UUIDUtils.java | 5 +-
.../org/apache/usergrid/AbstractCoreIT.java | 6 +-
.../org/apache/usergrid/CoreApplication.java | 11 +-
.../org/apache/usergrid/CoreITSetupImpl.java | 12 +-
.../usergrid/batch/job/TestJobListenerTest.java | 6 +-
.../count/BatchCountParallelismTest.java | 11 +-
.../locking/cassandra/HectorLockManagerIT.java | 10 +-
.../SingleNodeLockTestSingleNode.java | 10 +-
.../java/org/apache/usergrid/mq/MessagesIT.java | 62 +++++-----
.../org/apache/usergrid/mq/QueuePathsTest.java | 18 +--
.../usergrid/persistence/CollectionIT.java | 118 +++++++++----------
.../usergrid/persistence/CoreSchemaManager.java | 11 +-
.../apache/usergrid/persistence/CounterIT.java | 32 ++---
.../persistence/EntityConnectionsIT.java | 46 ++++----
.../persistence/EntityDictionaryIT.java | 24 ++--
.../usergrid/persistence/EntityManagerIT.java | 76 ++++++------
.../org/apache/usergrid/persistence/GeoIT.java | 21 ++--
.../persistence/GeoQueryBooleanTest.java | 7 +-
.../apache/usergrid/persistence/IndexIT.java | 43 +++----
.../apache/usergrid/persistence/SchemaTest.java | 18 +--
.../query/IntersectionTransitivePagingIT.java | 4 +-
.../query/IntersectionUnionPagingIT.java | 12 +-
.../persistence/query/IteratingQueryIT.java | 104 ++++++++--------
.../persistence/query/NotSubPropertyIT.java | 8 +-
.../apache/usergrid/utils/IndexUtilsTest.java | 6 +-
.../apache/usergrid/utils/JsonUtilsTest.java | 4 +-
.../apache/usergrid/utils/ListUtilsTest.java | 6 +-
.../org/apache/usergrid/utils/MapUtilsTest.java | 6 +-
.../apache/usergrid/utils/TestInflector.java | 6 +-
.../EntityCollectionManagerStressTest.java | 9 +-
.../changelog/ChangeLogGeneratorImplTest.java | 8 +-
.../stage/write/WriteOptimisticVerifyTest.java | 4 +-
.../migration/data/AbstractMigrationPlugin.java | 6 +-
.../persistence/core/astyanax/TestUtils.java | 6 +-
.../persistence/core/rx/OrderedMergeTest.java | 38 +++---
.../graph/impl/stage/EdgeDeleteRepairImpl.java | 12 +-
.../shard/impl/NodeShardAllocationImpl.java | 14 +--
.../shard/impl/ShardGroupCompactionImpl.java | 30 +++--
.../persistence/graph/GraphManagerLoadTest.java | 11 +-
.../graph/GraphManagerShardConsistencyIT.java | 35 +++---
.../graph/GraphManagerStressTest.java | 10 +-
.../graph/impl/NodeDeleteListenerTest.java | 6 +-
.../serialization/EdgeSerializationTest.java | 5 +-
.../graph/serialization/TestCount.java | 4 +-
.../persistence/index/impl/EntityIndexTest.java | 12 +-
.../usergrid/launcher/EmbeddedServerHelper.java | 10 +-
.../apache/usergrid/rest/PartialUpdateTest.java | 8 +-
.../org/apache/usergrid/rest/TomcatRuntime.java | 12 +-
.../applications/assets/AssetResourceIT.java | 10 +-
.../applications/assets/AwsAssetResourceIT.java | 12 +-
.../collection/users/UserResourceIT.java | 13 +-
.../users/extensions/TestResource.java | 5 +-
.../applications/queries/AndOrQueryTest.java | 6 +-
.../rest/applications/queries/OrderByTest.java | 8 +-
.../applications/queries/QueryTestBase.java | 4 +-
.../services/notifications/JobScheduler.java | 9 +-
.../notifications/NotificationsService.java | 12 +-
.../services/notifications/QueueListener.java | 49 ++++----
.../services/notifications/TaskManager.java | 43 +++----
.../impl/ApplicationQueueManagerImpl.java | 82 +++++++------
.../services/notifications/wns/WNSAdapter.java | 7 +-
.../usergrid/services/queues/QueueListener.java | 35 +++---
.../org/apache/usergrid/NewOrgAppAdminRule.java | 4 +-
.../org/apache/usergrid/ServiceApplication.java | 14 +--
.../apache/usergrid/management/EmailFlowIT.java | 22 ++--
.../org/apache/usergrid/management/RoleIT.java | 8 +-
.../cassandra/ManagementServiceIT.java | 12 +-
.../security/tokens/TokenServiceIT.java | 10 +-
.../usergrid/services/ServiceInvocationIT.java | 4 +-
.../java/org/apache/usergrid/TomcatMain.java | 10 +-
.../usergrid/cassandra/AvailablePortFinder.java | 18 +--
.../usergrid/cassandra/CassandraResource.java | 6 +-
.../usergrid/cassandra/ClearShiroSubject.java | 8 +-
.../usergrid/cassandra/SpringResource.java | 10 +-
.../usergrid/cassandra/SpringResourceTest.java | 10 +-
.../apache/usergrid/tools/WarehouseExport.java | 18 +--
.../apache/usergrid/tools/WarehouseUpsert.java | 30 ++---
.../websocket/WebSocketChannelHandler.java | 16 +--
82 files changed, 740 insertions(+), 791 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java b/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
index ce6422c..50bd9bc 100644
--- a/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
@@ -26,7 +26,6 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import com.google.inject.Injector;
-import org.apache.usergrid.corepersistence.CpSetup;
import org.apache.usergrid.persistence.core.metrics.MetricsFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -56,7 +55,7 @@ import com.google.common.util.concurrent.MoreExecutors;
public class JobSchedulerService extends AbstractScheduledService {
protected static final long DEFAULT_DELAY = 1000;
- private static final Logger LOG = LoggerFactory.getLogger( JobSchedulerService.class );
+ private static final Logger logger = LoggerFactory.getLogger( JobSchedulerService.class );
private long interval = DEFAULT_DELAY;
private int workerSize = 1;
@@ -94,7 +93,7 @@ public class JobSchedulerService extends AbstractScheduledService {
failCounter = metricsFactory.getCounter( JobSchedulerService.class, "scheduler.failed_jobs" );
try {
- LOG.info( "Running one check iteration ..." );
+ logger.info( "Running one check iteration ..." );
List<JobDescriptor> activeJobs;
// run until there are no more active jobs
@@ -102,8 +101,8 @@ public class JobSchedulerService extends AbstractScheduledService {
// get the semaphore if we can. This means we have space for at least 1
// job
- if ( LOG.isDebugEnabled() ) {
- LOG.debug( "About to acquire semaphore. Capacity is {}", capacitySemaphore.availablePermits() );
+ if ( logger.isDebugEnabled() ) {
+ logger.debug( "About to acquire semaphore. Capacity is {}", capacitySemaphore.availablePermits() );
}
capacitySemaphore.acquire();
@@ -113,30 +112,30 @@ public class JobSchedulerService extends AbstractScheduledService {
int capacity = capacitySemaphore.availablePermits();
- if (LOG.isDebugEnabled()) {
- LOG.debug("Capacity is {}", capacity);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Capacity is {}", capacity);
}
activeJobs = jobAccessor.getJobs( capacity );
// nothing to do, we don't have any jobs to run
if ( activeJobs.size() == 0 ) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("No jobs returned. Exiting run loop");
+ if (logger.isDebugEnabled()) {
+ logger.debug("No jobs returned. Exiting run loop");
}
return;
}
for ( JobDescriptor jd : activeJobs ) {
- LOG.info( "Submitting work for {}", jd );
+ logger.info( "Submitting work for {}", jd );
submitWork( jd );
- LOG.info( "Work submitted for {}", jd );
+ logger.info( "Work submitted for {}", jd );
}
}
}
catch ( Throwable t ) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Scheduler run failed, error is", t);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Scheduler run failed, error is", t);
}
}
}
@@ -163,7 +162,7 @@ public class JobSchedulerService extends AbstractScheduledService {
job = jobFactory.jobsFrom( jobDescriptor );
}
catch ( JobNotFoundException e ) {
- LOG.error( "Could not create jobs", e );
+ logger.error( "Could not create jobs", e );
return;
}
@@ -185,7 +184,7 @@ public class JobSchedulerService extends AbstractScheduledService {
capacitySemaphore.acquire();
}
catch ( InterruptedException e ) {
- LOG.error( "Unable to acquire semaphore capacity before submitting job", e );
+ logger.error( "Unable to acquire semaphore capacity before submitting job", e );
//just return, they'll get picked up again later
return;
}
@@ -198,8 +197,8 @@ public class JobSchedulerService extends AbstractScheduledService {
@Override
public Void call() throws Exception {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Starting the job with job id {}", execution.getJobId());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Starting the job with job id {}", execution.getJobId());
}
runCounter.inc();
@@ -216,7 +215,7 @@ public class JobSchedulerService extends AbstractScheduledService {
catch ( Exception t ) {
//we purposefully swallow all exceptions here, we don't want it to effect the outcome
//of finally popping this job from the queue
- LOG.error( "Unable to invoke dead event on job", t );
+ logger.error( "Unable to invoke dead event on job", t );
}
return null;
@@ -227,7 +226,7 @@ public class JobSchedulerService extends AbstractScheduledService {
// TODO wrap and throw specifically typed exception for onFailure,
// needs jobId
- LOG.info( "Starting job {} with execution data {}", job, execution );
+ logger.info( "Starting job {} with execution data {}", job, execution );
job.execute( execution );
@@ -247,8 +246,8 @@ public class JobSchedulerService extends AbstractScheduledService {
* Release semaphore first in case there are other problems with communicating with Cassandra
*/
- if (LOG.isDebugEnabled()) {
- LOG.debug("Job succeeded with the job id {}", execution.getJobId());
+ if (logger.isDebugEnabled()) {
+ logger.debug("Job succeeded with the job id {}", execution.getJobId());
}
capacitySemaphore.release();
timer.stop();
@@ -258,7 +257,7 @@ public class JobSchedulerService extends AbstractScheduledService {
//TODO, refactor into the execution itself for checking if done
if ( execution.getStatus() == Status.IN_PROGRESS ) {
- LOG.info( "Successful completion of bulkJob {}", execution );
+ logger.info( "Successful completion of bulkJob {}", execution );
execution.completed();
}
@@ -277,14 +276,14 @@ public class JobSchedulerService extends AbstractScheduledService {
/**
* Release semaphore first in case there are other problems with communicating with Cassandra
*/
- LOG.error( "Job failed with the job id {}", execution.getJobId() );
+ logger.error( "Job failed with the job id {}", execution.getJobId() );
capacitySemaphore.release();
timer.stop();
runCounter.dec();
failCounter.inc();
- LOG.error( "Failed execution for bulkJob", throwable );
+ logger.error( "Failed execution for bulkJob", throwable );
// mark it as failed
if ( execution.getStatus() == Status.IN_PROGRESS ) {
execution.failed();
@@ -374,11 +373,11 @@ public class JobSchedulerService extends AbstractScheduledService {
.listeningDecorator( Executors.newScheduledThreadPool( workerSize, JobThreadFactory.INSTANCE ) );
capacitySemaphore = new Semaphore( workerSize );
- LOG.info( "Starting executor pool. Capacity is {}", workerSize );
+ logger.info( "Starting executor pool. Capacity is {}", workerSize );
super.startUp();
- LOG.info( "Job Scheduler started" );
+ logger.info( "Job Scheduler started" );
}
@@ -389,11 +388,11 @@ public class JobSchedulerService extends AbstractScheduledService {
*/
@Override
protected void shutDown() throws Exception {
- LOG.info( "Shutting down job scheduler" );
+ logger.info( "Shutting down job scheduler" );
service.shutdown();
- LOG.info( "Job scheduler shut down" );
+ logger.info( "Job scheduler shut down" );
super.shutDown();
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/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 d69cbb1..b0a5f08 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
@@ -62,7 +62,7 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
private static final String JOB_NAME = "jobName";
- private static final Logger LOG = LoggerFactory.getLogger( SchedulerServiceImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( SchedulerServiceImpl.class );
private static final String DEFAULT_QUEUE_NAME = "/jobs";
@@ -144,8 +144,8 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
* as discarded
*/
try {
- if (LOG.isDebugEnabled()) {
- LOG.debug("deleteJob {}", jobId);
+ if (logger.isDebugEnabled()) {
+ logger.debug("deleteJob {}", jobId);
}
getEm().delete( new SimpleEntityRef(
Schema.getDefaultSchema().getEntityType(JobData.class), jobId ) );
@@ -189,7 +189,7 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
* still fire. Ignore this job
*/
if ( data == null || stats == null ) {
- LOG.info( "Received job with data id '{}' from the queue, but no data was found. Dropping job",
+ logger.info( "Received job with data id '{}' from the queue, but no data was found. Dropping job",
jobUuid );
getQm().deleteTransaction( jobQueueName, job.getTransaction(), null );
@@ -210,7 +210,7 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
// log and skip. This is a catastrophic runtime error if we see an
// exception here. We don't want to cause job loss, so leave the job in
// the Q.
- LOG.error(
+ logger.error(
"Unable to retrieve job data for jobname {}, job id {}, stats id {}. Skipping to avoid job "
+ "loss", new Object[] { jobName, jobUuid, statsUuid, e } );
}
@@ -222,8 +222,8 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
@Override
public void heartbeat( JobRuntime execution, long delay ) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("renew transaction {}", execution.getTransactionId());
+ if (logger.isDebugEnabled()) {
+ logger.debug("renew transaction {}", execution.getTransactionId());
}
try {
// @TODO - what's the point to this sychronized block on an argument?
@@ -232,13 +232,13 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
new QueueQuery().withTimeout( delay ) );
execution.setTransactionId( newId );
- if (LOG.isDebugEnabled()) {
- LOG.debug("renewed transaction {}", newId);
+ if (logger.isDebugEnabled()) {
+ logger.debug("renewed transaction {}", newId);
}
}
}
catch ( TransactionNotFoundException e ) {
- LOG.error( "Could not renew transaction", e );
+ logger.error( "Could not renew transaction", e );
throw new JobRuntimeException( "Could not renew transaction during heartbeat", e );
}
}
@@ -284,10 +284,10 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
// we're done. Mark the transaction as complete and delete the job info
if ( jobStatus == Status.COMPLETED ) {
- LOG.info( "Job {} is complete id: {}", data.getJobName(), bulkJobExecution.getTransactionId() );
+ logger.info( "Job {} is complete id: {}", data.getJobName(), bulkJobExecution.getTransactionId() );
getQm().deleteTransaction( jobQueueName, bulkJobExecution.getTransactionId(), null );
- if (LOG.isDebugEnabled()) {
- LOG.debug("delete job data {}", data.getUuid());
+ if (logger.isDebugEnabled()) {
+ logger.debug("delete job data {}", data.getUuid());
}
getEm().delete( data );
}
@@ -295,7 +295,7 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
// the job failed too many times. Delete the transaction to prevent it
// running again and save it for querying later
else if ( jobStatus == Status.DEAD ) {
- LOG.warn( "Job {} is dead. Removing", data.getJobName() );
+ logger.warn( "Job {} is dead. Removing", data.getJobName() );
getQm().deleteTransaction( jobQueueName, bulkJobExecution.getTransactionId(), null );
getEm().update( data );
}
@@ -305,7 +305,7 @@ public class SchedulerServiceImpl implements SchedulerService, JobAccessor, JobR
getEm().update( data );
}
- LOG.info( "Updating stats for job {}", data.getJobName() );
+ logger.info( "Updating stats for job {}", data.getJobName() );
getEm().update( stat );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/main/java/org/apache/usergrid/count/Slf4JBatchSubmitter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/count/Slf4JBatchSubmitter.java b/stack/core/src/main/java/org/apache/usergrid/count/Slf4JBatchSubmitter.java
index 68f3b32..2058454 100644
--- a/stack/core/src/main/java/org/apache/usergrid/count/Slf4JBatchSubmitter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/count/Slf4JBatchSubmitter.java
@@ -42,7 +42,7 @@ public class Slf4JBatchSubmitter implements BatchSubmitter {
// TODO custom logger for printing counts
// - should be configed programatically
- private static final Logger log = LoggerFactory.getLogger( Slf4JBatchSubmitter.class );
+ private static final Logger logger = LoggerFactory.getLogger( Slf4JBatchSubmitter.class );
private int threadCount = 3;
@@ -62,7 +62,7 @@ public class Slf4JBatchSubmitter implements BatchSubmitter {
// TODO perhaps this could be pushed down further into CountProducer Impl?
// - this would leave generic submitter class
for ( Count c : counts ) {
- log.info( "found count {}", c );
+ logger.info( "found count {}", c );
}
timer.stop();
return true;
@@ -72,7 +72,7 @@ public class Slf4JBatchSubmitter implements BatchSubmitter {
public void shutdown() {
- log.warn( "Shutdown Slf4jBatchSubmitter" );
+ logger.warn( "Shutdown Slf4jBatchSubmitter" );
executor.shutdown();
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/main/java/org/apache/usergrid/utils/MapUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/MapUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/MapUtils.java
index 12da2e0..2d0f0e3 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/MapUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/MapUtils.java
@@ -136,7 +136,7 @@ public class MapUtils extends org.apache.commons.collections.MapUtils {
v = ( V ) map.get( k );
}
catch ( ClassCastException e ) {
- //LOG.war( "Map value {} was not the expected class", map.get( k ), e );
+ //logger.war( "Map value {} was not the expected class", map.get( k ), e );
}
return v;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java
index adde4b6..a43049d 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java
@@ -21,7 +21,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.UUID;
-import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;
@@ -47,7 +46,7 @@ import static org.apache.usergrid.utils.ConversionUtils.uuid;
public class UUIDUtils {
- private static final Logger LOG = LoggerFactory.getLogger( UUIDUtils.class );
+ private static final Logger logger = LoggerFactory.getLogger( UUIDUtils.class );
private static final int[] MICROS = new int[1000];
@@ -324,7 +323,7 @@ public class UUIDUtils {
uuid = UUID.fromString( s );
}
catch ( Exception e ) {
- LOG.info( "Could not convert String {} into a UUID", s, e );
+ logger.info( "Could not convert String {} into a UUID", s, e );
}
return uuid;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/AbstractCoreIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/AbstractCoreIT.java b/stack/core/src/test/java/org/apache/usergrid/AbstractCoreIT.java
index 53ad348..3c7a368 100644
--- a/stack/core/src/test/java/org/apache/usergrid/AbstractCoreIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/AbstractCoreIT.java
@@ -27,7 +27,7 @@ import org.apache.usergrid.utils.JsonUtils;
public abstract class AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( AbstractCoreIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( AbstractCoreIT.class );
@ClassRule
public static CoreITSetup setup = new CoreITSetupImpl( );
@@ -38,8 +38,8 @@ public abstract class AbstractCoreIT {
public void dump( String name, Object obj ) {
- if ( obj != null && LOG.isInfoEnabled() ) {
- LOG.info( name + ":\n" + JsonUtils.mapToFormattedJsonString( obj ) );
+ if ( obj != null && logger.isInfoEnabled() ) {
+ logger.info( name + ":\n" + JsonUtils.mapToFormattedJsonString( obj ) );
}
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java b/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java
index fa48939..9046f02 100644
--- a/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java
+++ b/stack/core/src/test/java/org/apache/usergrid/CoreApplication.java
@@ -18,17 +18,12 @@ package org.apache.usergrid;
import java.util.*;
-import java.util.concurrent.ExecutionException;
import com.google.inject.Injector;
import org.apache.usergrid.corepersistence.index.IndexLocationStrategyFactory;
import org.apache.usergrid.corepersistence.service.ApplicationService;
import org.apache.usergrid.corepersistence.util.CpNamingUtils;
import org.apache.usergrid.persistence.index.*;
-import org.apache.usergrid.persistence.index.utils.MapUtils;
-import org.apache.usergrid.persistence.model.entity.Id;
-import org.apache.usergrid.persistence.model.entity.SimpleId;
-import org.apache.usergrid.utils.InflectionUtils;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
@@ -49,7 +44,7 @@ import static junit.framework.Assert.assertNotNull;
public class CoreApplication implements Application, TestRule {
- private static final Logger LOG = LoggerFactory.getLogger( CoreApplication.class );
+ private static final Logger logger = LoggerFactory.getLogger( CoreApplication.class );
protected UUID id;
protected String appName;
protected String orgName;
@@ -153,7 +148,7 @@ public class CoreApplication implements Application, TestRule {
protected void after( Description description ) {
- LOG.info("Test {}: finish with application", description.getDisplayName());
+ logger.info("Test {}: finish with application", description.getDisplayName());
// try {
// setup.getEmf().getEntityManager(id).().get();
@@ -184,7 +179,7 @@ public class CoreApplication implements Application, TestRule {
);
assertNotNull(em);
- LOG.info( "Created new application {} in organization {}", appName, orgName );
+ logger.info( "Created new application {} in organization {}", appName, orgName );
// //wait for the index before proceeding
// em.refreshIndex();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java b/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java
index d2129a4..6f9b384 100644
--- a/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java
+++ b/stack/core/src/test/java/org/apache/usergrid/CoreITSetupImpl.java
@@ -23,11 +23,9 @@ import org.apache.usergrid.corepersistence.service.ApplicationService;
import org.apache.usergrid.mq.QueueManagerFactory;
import org.apache.usergrid.persistence.Entity;
import org.apache.usergrid.persistence.EntityManagerFactory;
-import org.apache.usergrid.persistence.IndexBucketLocator;
import org.apache.usergrid.persistence.cassandra.CassandraService;
import org.apache.usergrid.setup.ConcurrentProcessSingleton;
import org.apache.usergrid.utils.JsonUtils;
-import org.apache.usergrid.utils.UUIDUtils;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.slf4j.Logger;
@@ -37,7 +35,7 @@ import java.util.UUID;
public class CoreITSetupImpl implements CoreITSetup, TestEntityIndex {
- private static final Logger LOG = LoggerFactory.getLogger( CoreITSetupImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( CoreITSetupImpl.class );
private final Injector injector;
protected EntityManagerFactory emf;
@@ -88,7 +86,7 @@ public class CoreITSetupImpl implements CoreITSetup, TestEntityIndex {
* @throws Throwable if setup fails (which will disable {@code after}
*/
protected void before( Description description ) throws Throwable {
- LOG.info( "Setting up for {}", description.getDisplayName() );
+ logger.info( "Setting up for {}", description.getDisplayName() );
@@ -99,7 +97,7 @@ public class CoreITSetupImpl implements CoreITSetup, TestEntityIndex {
/** Override to tear down your specific external resource. */
protected void after( Description description ) {
- LOG.info( "Tearing down for {}", description.getDisplayName() );
+ logger.info( "Tearing down for {}", description.getDisplayName() );
}
@@ -136,8 +134,8 @@ public class CoreITSetupImpl implements CoreITSetup, TestEntityIndex {
@Override
public void dump( String name, Object obj ) {
- if ( obj != null && LOG.isInfoEnabled() ) {
- LOG.info( name + ":\n" + JsonUtils.mapToFormattedJsonString( obj ) );
+ if ( obj != null && logger.isInfoEnabled() ) {
+ logger.info( name + ":\n" + JsonUtils.mapToFormattedJsonString( obj ) );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListenerTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListenerTest.java b/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListenerTest.java
index 96364da..8c01062 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListenerTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/TestJobListenerTest.java
@@ -32,7 +32,7 @@ import static org.junit.Assert.assertTrue;
* Tests the TestJobListener.
*/
public class TestJobListenerTest {
- private static final Logger LOG = LoggerFactory.getLogger( TestJobListenerTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( TestJobListenerTest.class );
JobExecution jobExecution = new JobExecution() {
@Override
public JobData getJobData() {
@@ -113,7 +113,7 @@ public class TestJobListenerTest {
listener.setExpected( 100 );
listener.blockTilDone( waitTime );
long elapsedTime = System.currentTimeMillis() - startTime;
- LOG.info( "IdleOut in {} millis", elapsedTime );
+ logger.info( "IdleOut in {} millis", elapsedTime );
// assertTrue( elapsedTime >= ( 1000L + TestJobListener.WAIT_MAX_MILLIS ) );
assertTrue("Elapsed time: " + elapsedTime + " fails to be greater than idle wait time: " + waitTime, elapsedTime>= waitTime );
}
@@ -132,7 +132,7 @@ public class TestJobListenerTest {
Thread.sleep( 100 );
}
catch ( InterruptedException e ) {
- LOG.warn( "Thread got interrupted", e );
+ logger.warn( "Thread got interrupted", e );
}
for ( int ii = 0; ii < 1000; ii++ ) {
listener.onSuccess( jobExecution );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/count/BatchCountParallelismTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/count/BatchCountParallelismTest.java b/stack/core/src/test/java/org/apache/usergrid/count/BatchCountParallelismTest.java
index 78c58a4..1db916c 100644
--- a/stack/core/src/test/java/org/apache/usergrid/count/BatchCountParallelismTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/count/BatchCountParallelismTest.java
@@ -30,7 +30,6 @@ import java.util.concurrent.atomic.AtomicLong;
import org.apache.usergrid.ExperimentalTest;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
@@ -45,7 +44,7 @@ import static org.junit.Assert.assertEquals;
@net.jcip.annotations.NotThreadSafe
public class BatchCountParallelismTest {
- private static final Logger LOG = LoggerFactory.getLogger( BatchCountParallelismTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( BatchCountParallelismTest.class );
private ExecutorService exec = Executors.newFixedThreadPool( 24 );
private SimpleBatcher batcher;
private StubSubmitter submitter = new StubSubmitter();
@@ -89,21 +88,21 @@ public class BatchCountParallelismTest {
Count count = new Count( "Counter", "k1", "counter1", 1 );
batcher.add( count );
}
- LOG.info( "Task iteration # {} : ", c );
+ logger.info( "Task iteration # {} : ", c );
cdl.countDown();
return true;
}
} ) );
}
batcher.add( new Count( "Counter", "k1", "counter1", 1 ) );
- LOG.info( "size: " + calls.size() );
+ logger.info( "size: " + calls.size() );
cdl.await();
// exec.awaitTermination(2,TimeUnit.SECONDS);
exec.shutdown();
while (! exec.awaitTermination( 3, TimeUnit.SECONDS ) ) {
- LOG.warn("jobs not yet finished, wait again");
+ logger.warn("jobs not yet finished, wait again");
}
// we should have 100 total invocations of AbstractBatcher#add
@@ -138,7 +137,7 @@ public class BatchCountParallelismTest {
@Override
public Future<?> submit( Collection<Count> counts ) {
- LOG.info( "submitted: " + counts.size() );
+ logger.info( "submitted: " + counts.size() );
counted.addAndGet( counts.size() );
submit.incrementAndGet();
return null;
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/locking/cassandra/HectorLockManagerIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/locking/cassandra/HectorLockManagerIT.java b/stack/core/src/test/java/org/apache/usergrid/locking/cassandra/HectorLockManagerIT.java
index 8351cb2..34b2154 100644
--- a/stack/core/src/test/java/org/apache/usergrid/locking/cassandra/HectorLockManagerIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/locking/cassandra/HectorLockManagerIT.java
@@ -46,7 +46,7 @@ import static org.junit.Assert.assertTrue;
public class HectorLockManagerIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( HectorLockManagerIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( HectorLockManagerIT.class );
private static LockManager manager;
private static ExecutorService pool;
@@ -89,7 +89,7 @@ public class HectorLockManagerIT extends AbstractCoreIT {
final UUID application = UUID.randomUUID();
final UUID entity = UUID.randomUUID();
- LOG.info( "Locking:" + application.toString() + "/" + entity.toString() );
+ logger.info( "Locking:" + application.toString() + "/" + entity.toString() );
// Lock a node twice to test re-entrancy and validate.
Lock lock = manager.createLock( application, entity.toString() );
@@ -107,7 +107,7 @@ public class HectorLockManagerIT extends AbstractCoreIT {
assertFalse( wasLocked );
// Unlock completely
- LOG.info( "Releasing lock:" + application.toString() + "/" + entity.toString() );
+ logger.info( "Releasing lock:" + application.toString() + "/" + entity.toString() );
lock.unlock();
// Try to effectively get the lock from the thread since the current one has
@@ -124,7 +124,7 @@ public class HectorLockManagerIT extends AbstractCoreIT {
final UUID entity = UUID.randomUUID();
final UUID entity2 = UUID.randomUUID();
- LOG.info( "Locking:" + application.toString() + "/" + entity.toString() );
+ logger.info( "Locking:" + application.toString() + "/" + entity.toString() );
// Acquire to locks. One of them twice.
Lock lock = manager.createLock( application, entity.toString() );
@@ -135,7 +135,7 @@ public class HectorLockManagerIT extends AbstractCoreIT {
second.lock();
// Cleanup the locks for main thread
- LOG.info( "Cleaning up locks for current thread..." );
+ logger.info( "Cleaning up locks for current thread..." );
lock.unlock();
lock.unlock();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/locking/singlenode/SingleNodeLockTestSingleNode.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/locking/singlenode/SingleNodeLockTestSingleNode.java b/stack/core/src/test/java/org/apache/usergrid/locking/singlenode/SingleNodeLockTestSingleNode.java
index b6d58d7..db1defd 100644
--- a/stack/core/src/test/java/org/apache/usergrid/locking/singlenode/SingleNodeLockTestSingleNode.java
+++ b/stack/core/src/test/java/org/apache/usergrid/locking/singlenode/SingleNodeLockTestSingleNode.java
@@ -41,7 +41,7 @@ import static org.junit.Assert.assertTrue;
public class SingleNodeLockTestSingleNode {
- private static final Logger LOG = LoggerFactory.getLogger( SingleNodeLockTestSingleNode.class );
+ private static final Logger logger = LoggerFactory.getLogger( SingleNodeLockTestSingleNode.class );
private LockManager manager;
@@ -72,7 +72,7 @@ public class SingleNodeLockTestSingleNode {
final UUID application = UUID.randomUUID();
final UUID entity = UUID.randomUUID();
- LOG.info( "Locking:" + application.toString() + "/" + entity.toString() );
+ logger.info( "Locking:" + application.toString() + "/" + entity.toString() );
// Lock a node twice to test reentrancy and validate.
Lock lock = manager.createLock( application, entity.toString() );
@@ -91,7 +91,7 @@ public class SingleNodeLockTestSingleNode {
Assert.assertEquals( false, wasLocked );
// Unlock completely
- LOG.info( "Releasing lock:" + application.toString() + "/" + entity.toString() );
+ logger.info( "Releasing lock:" + application.toString() + "/" + entity.toString() );
lock.unlock();
// Try to effectively get the lock from the thread since the current one has
@@ -109,7 +109,7 @@ public class SingleNodeLockTestSingleNode {
final UUID entity = UUID.randomUUID();
final UUID entity2 = UUID.randomUUID();
- LOG.info( "Locking:" + application.toString() + "/" + entity.toString() );
+ logger.info( "Locking:" + application.toString() + "/" + entity.toString() );
// Acquire to locks. One of them twice.
Lock lock = manager.createLock( application, entity.toString() );
@@ -120,7 +120,7 @@ public class SingleNodeLockTestSingleNode {
second.lock();
// Cleanup the locks for main thread
- LOG.info( "Cleaning up locks for current thread..." );
+ logger.info( "Cleaning up locks for current thread..." );
lock.unlock();
lock.unlock();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/mq/MessagesIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/mq/MessagesIT.java b/stack/core/src/test/java/org/apache/usergrid/mq/MessagesIT.java
index 52ca4d8..2edb012 100644
--- a/stack/core/src/test/java/org/apache/usergrid/mq/MessagesIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/mq/MessagesIT.java
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertTrue;
public class MessagesIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( MessagesIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( MessagesIT.class );
@Rule
public ImmediateCounterRule counterRule = new ImmediateCounterRule( );
@@ -51,32 +51,32 @@ public class MessagesIT extends AbstractCoreIT {
@Ignore("Pending https://issues.apache.org/jira/browse/USERGRID-1116. ")
@Test
public void testMessages() throws Exception {
- LOG.info( "MessagesIT.testMessages" );
+ logger.info( "MessagesIT.testMessages" );
Message message = new Message();
message.setStringProperty( "foo", "bar" );
- LOG.info( JsonUtils.mapToFormattedJsonString( message ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( message ) );
- LOG.info( "Posting message #1 to queue /foo/bar" );
+ logger.info( "Posting message #1 to queue /foo/bar" );
QueueManager qm = app.getQm();
qm.postToQueue( "/foo/bar", message );
- LOG.info( "Getting message #1" );
+ logger.info( "Getting message #1" );
message = qm.getMessage( message.getUuid() );
- LOG.info( JsonUtils.mapToFormattedJsonString( message ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( message ) );
- LOG.info( "Getting message from /foo/bar, should be message #1" );
+ logger.info( "Getting message from /foo/bar, should be message #1" );
QueueResults messages = qm.getFromQueue( "/foo/bar", null );
- LOG.info( JsonUtils.mapToFormattedJsonString( messages ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( messages ) );
assertEquals( 1, messages.size() );
- LOG.info( "Getting message from /foo/bar, should empty" );
+ logger.info( "Getting message from /foo/bar, should empty" );
messages = qm.getFromQueue( "/foo/bar", null );
- LOG.info( JsonUtils.mapToFormattedJsonString( messages ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( messages ) );
assertEquals( 0, messages.size() );
message = new Message();
@@ -88,21 +88,21 @@ public class MessagesIT extends AbstractCoreIT {
qm.postToQueue( "/foo/bar", message );
/*
messages = qm.getFromQueue("/foo/bar", null);
- LOG.info(JsonUtils.mapToFormattedJsonString(messages));
+ logger.info(JsonUtils.mapToFormattedJsonString(messages));
assertEquals(1, messages.size());
messages = qm.getFromQueue("/foo/bar", null);
- LOG.info(JsonUtils.mapToFormattedJsonString(messages));
+ logger.info(JsonUtils.mapToFormattedJsonString(messages));
assertEquals(1, messages.size());
messages = qm.getFromQueue("/foo/bar", null);
- LOG.info(JsonUtils.mapToFormattedJsonString(messages));
+ logger.info(JsonUtils.mapToFormattedJsonString(messages));
assertEquals(0, messages.size());
messages = qm.getFromQueue("/foo/bar",
new QueueQuery().withPosition(QueuePosition.END)
.withPreviousCount(3));
- LOG.info(JsonUtils.mapToFormattedJsonString(messages));
+ logger.info(JsonUtils.mapToFormattedJsonString(messages));
assertEquals(3, messages.size());
*/
@@ -110,8 +110,8 @@ public class MessagesIT extends AbstractCoreIT {
//TODO Re-evaluate queues and make a cleaner interface
// Map<String, Long> counters = qm.getQueueCounters( "/" );
-// LOG.info( "dumping counters...." + counters );
-// LOG.info( JsonUtils.mapToFormattedJsonString( counters ) );
+// logger.info( "dumping counters...." + counters );
+// logger.info( JsonUtils.mapToFormattedJsonString( counters ) );
// assertEquals( 1, counters.size() );
// assertNotNull( counters.get( "/foo/bar/" ) );
// assertEquals( new Long( 3 ), counters.get( "/foo/bar/" ) );
@@ -126,47 +126,47 @@ public class MessagesIT extends AbstractCoreIT {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put( "foo", "alpha" );
Queue q = qm.updateQueue( "/foo/1/", properties );
- LOG.info( JsonUtils.mapToFormattedJsonString( q ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( q ) );
q = qm.getQueue( "/foo/1/" );
- LOG.info( JsonUtils.mapToFormattedJsonString( q ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( q ) );
assertEquals( "alpha", q.getStringProperty( "foo" ) );
properties = new HashMap<String, Object>();
properties.put( "foo", "bravo" );
q = qm.updateQueue( "/foo/2/", properties );
- LOG.info( JsonUtils.mapToFormattedJsonString( q ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( q ) );
properties = new HashMap<String, Object>();
properties.put( "foo", "charlie" );
q = qm.updateQueue( "/foo/3/", properties );
- LOG.info( JsonUtils.mapToFormattedJsonString( q ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( q ) );
qm.subscribeToQueue( "/pubtest/", "/foo/1/" );
qm.subscribeToQueue( "/pubtest/", "/foo/2/" );
qm.subscribeToQueue( "/pubtest/", "/foo/3/" );
QueueSet results = qm.searchSubscribers( "/pubtest/", Query.findForProperty( "foo", "bravo" ) );
- LOG.info( JsonUtils.mapToFormattedJsonString( results ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( results ) );
assertEquals( 1, results.size() );
properties = new HashMap<String, Object>();
properties.put( "foo", "delta" );
q = qm.updateQueue( "/foo/2/", properties );
- LOG.info( JsonUtils.mapToFormattedJsonString( q ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( q ) );
results = qm.searchSubscribers( "/pubtest/", Query.findForProperty( "foo", "bravo" ) );
- LOG.info( JsonUtils.mapToFormattedJsonString( results ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( results ) );
assertEquals( 0, results.size() );
results = qm.searchSubscribers( "/pubtest/", Query.findForProperty( "foo", "delta" ) );
- LOG.info( JsonUtils.mapToFormattedJsonString( results ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( results ) );
assertEquals( 1, results.size() );
qm.unsubscribeFromQueue( "/pubtest/", "/foo/2/" );
results = qm.searchSubscribers( "/pubtest/", Query.findForProperty( "foo", "delta" ) );
- LOG.info( JsonUtils.mapToFormattedJsonString( results ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( results ) );
assertEquals( 0, results.size() );
}
@@ -174,7 +174,7 @@ public class MessagesIT extends AbstractCoreIT {
@Ignore("Pending https://issues.apache.org/jira/browse/USERGRID-1116. ")
@Test
public void testConsumer() throws Exception {
- LOG.info( "Creating messages" );
+ logger.info( "Creating messages" );
QueueManager qm = app.getQm();
Message message;
@@ -183,14 +183,14 @@ public class MessagesIT extends AbstractCoreIT {
message = new Message();
message.setStringProperty( "foo", "bar" + i );
- LOG.info( "Posting message #" + i + " to queue /foo/bar: " + message.getUuid() );
+ logger.info( "Posting message #" + i + " to queue /foo/bar: " + message.getUuid() );
qm.postToQueue( "/foo/bar", message );
}
for ( int i = 0; i < 11; i++ ) {
QueueResults messages = qm.getFromQueue( "/foo/bar", new QueueQuery().withConsumer( "consumer1" ) );
- LOG.info( JsonUtils.mapToFormattedJsonString( messages ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( messages ) );
if ( i < 10 ) {
assertEquals( 1, messages.size() );
assertEquals( "bar" + i, messages.getMessages().get( 0 ).getStringProperty( "foo" ) );
@@ -202,7 +202,7 @@ public class MessagesIT extends AbstractCoreIT {
for ( int i = 0; i < 11; i++ ) {
QueueResults messages = qm.getFromQueue( "/foo/bar", new QueueQuery().withConsumer( "consumer2" ) );
- LOG.info( JsonUtils.mapToFormattedJsonString( messages ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( messages ) );
if ( i < 10 ) {
assertEquals( 1, messages.size() );
assertEquals( "bar" + i, messages.getMessages().get( 0 ).getStringProperty( "foo" ) );
@@ -228,7 +228,7 @@ public class MessagesIT extends AbstractCoreIT {
// create 2 messages
Message message = new Message();
message.setStringProperty( "foo", "bar" );
- LOG.info( "Posting message to queue " + queuePath + ": " + message.getUuid() );
+ logger.info( "Posting message to queue " + queuePath + ": " + message.getUuid() );
Message posted1 = qm.postToQueue( queuePath, message );
assertTrue( qm.hasMessagesInQueue( queuePath, null ) );
@@ -237,7 +237,7 @@ public class MessagesIT extends AbstractCoreIT {
message = new Message();
message.setStringProperty( "foo", "bar" );
- LOG.info( "Posting message to queue " + queuePath + ": " + message.getUuid() );
+ logger.info( "Posting message to queue " + queuePath + ": " + message.getUuid() );
Message posted2 = qm.postToQueue( queuePath, message );
assertTrue( qm.hasMessagesInQueue( queuePath, null ) );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/mq/QueuePathsTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/mq/QueuePathsTest.java b/stack/core/src/test/java/org/apache/usergrid/mq/QueuePathsTest.java
index a53576e..86dc8bc 100644
--- a/stack/core/src/test/java/org/apache/usergrid/mq/QueuePathsTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/mq/QueuePathsTest.java
@@ -28,7 +28,7 @@ import static org.apache.usergrid.utils.JsonUtils.mapToFormattedJsonString;
public class QueuePathsTest {
- private static final Logger LOG = LoggerFactory.getLogger( QueuePathsTest.class );
+ private static final Logger logger = LoggerFactory.getLogger( QueuePathsTest.class );
@Test
@@ -36,13 +36,13 @@ public class QueuePathsTest {
// tests should not be written like this: what's the point? If it's
// code coverage this is still bad.
public void testPaths() throws Exception {
- LOG.info( normalizeQueuePath( "a/b/c" ) );
- LOG.info( normalizeQueuePath( "a/b/c/" ) );
- LOG.info( normalizeQueuePath( "/a/b/c" ) );
- LOG.info( normalizeQueuePath( "/////a/b/c" ) );
- LOG.info( normalizeQueuePath( "/" ) );
-
- LOG.info( mapToFormattedJsonString( getQueueParentPaths( "/a/b/c" ) ) );
- LOG.info( mapToFormattedJsonString( getQueueParentPaths( "/" ) ) );
+ logger.info( normalizeQueuePath( "a/b/c" ) );
+ logger.info( normalizeQueuePath( "a/b/c/" ) );
+ logger.info( normalizeQueuePath( "/a/b/c" ) );
+ logger.info( normalizeQueuePath( "/////a/b/c" ) );
+ logger.info( normalizeQueuePath( "/" ) );
+
+ logger.info( mapToFormattedJsonString( getQueueParentPaths( "/a/b/c" ) ) );
+ logger.info( mapToFormattedJsonString( getQueueParentPaths( "/" ) ) );
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
index 1c67cc7..3305e0e 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
@@ -33,8 +33,6 @@ import org.apache.usergrid.persistence.exceptions.DuplicateUniquePropertyExistsE
import org.apache.usergrid.persistence.index.query.Identifier;
import org.apache.usergrid.utils.JsonUtils;
import org.apache.usergrid.utils.UUIDUtils;
-import rx.Observable;
-import rx.schedulers.Schedulers;
import static org.apache.usergrid.utils.MapUtils.hashMap;
import static org.junit.Assert.assertEquals;
@@ -48,7 +46,7 @@ import static org.junit.Assert.fail;
//@UseModules({ GuiceModule.class })
public class CollectionIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( CollectionIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( CollectionIT.class );
@Rule
public Application app = new CoreApplication( setup );
@@ -57,7 +55,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testSimpleCrud() throws Exception {
- LOG.debug( "testSimpleCrud" );
+ logger.debug( "testSimpleCrud" );
app.put( "username", "edanuff" );
app.put( "email", "ed@anuff.com" );
@@ -75,7 +73,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testCollection() throws Exception {
- LOG.debug( "testCollection" );
+ logger.debug( "testCollection" );
app.put( "username", "edanuff" );
app.put( "email", "ed@anuff.com" );
@@ -96,13 +94,13 @@ public class CollectionIT extends AbstractCoreIT {
Entity activity = app.create( "activity" );
assertNotNull( activity );
- LOG.info( "" + activity.getClass() );
- LOG.info( JsonUtils.mapToFormattedJsonString( activity ) );
+ logger.info( "" + activity.getClass() );
+ logger.info( JsonUtils.mapToFormattedJsonString( activity ) );
activity = app.get( activity.getUuid(), activity.getType() );
- LOG.info( "Activity class = {}", activity.getClass() );
- LOG.info( JsonUtils.mapToFormattedJsonString( activity ) );
+ logger.info( "Activity class = {}", activity.getClass() );
+ logger.info( JsonUtils.mapToFormattedJsonString( activity ) );
app.addToCollection( user, "activities", activity );
@@ -170,7 +168,7 @@ public class CollectionIT extends AbstractCoreIT {
r = app.searchCollection( user, "activities", query );
assertEquals( 3, r.size() );
entities = r.getEntities();
- LOG.info( JsonUtils.mapToFormattedJsonString( entities ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( entities ) );
assertEquals( entities.get( 0 ).getUuid(), activity2.getUuid() );
assertEquals( entities.get( 1 ).getUuid(), activity.getUuid() );
assertEquals( entities.get( 2 ).getUuid(), activity3.getUuid() );
@@ -202,7 +200,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void containsTest() throws Exception {
- LOG.debug("testCollection");
+ logger.debug("testCollection");
app.put("username", "edanuff");
app.put("email", "ed@anuff.com");
@@ -223,13 +221,13 @@ public class CollectionIT extends AbstractCoreIT {
Entity activity = app.create("activity");
assertNotNull(activity);
- LOG.info("" + activity.getClass());
- LOG.info(JsonUtils.mapToFormattedJsonString(activity));
+ logger.info("" + activity.getClass());
+ logger.info(JsonUtils.mapToFormattedJsonString(activity));
activity = app.get(activity.getUuid(), activity.getType());
- LOG.info("Activity class = {}", activity.getClass());
- LOG.info(JsonUtils.mapToFormattedJsonString(activity));
+ logger.info("Activity class = {}", activity.getClass());
+ logger.info(JsonUtils.mapToFormattedJsonString(activity));
app.addToCollection(user, "activities", activity);
@@ -281,7 +279,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void userFirstNameSearch() throws Exception {
- LOG.debug( "userFirstNameSearch" );
+ logger.debug( "userFirstNameSearch" );
EntityManager em = app.getEntityManager();
@@ -341,7 +339,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void userMiddleNameSearch() throws Exception {
- LOG.debug( "userMiddleNameSearch" );
+ logger.debug( "userMiddleNameSearch" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -373,7 +371,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void userLastNameSearch() throws Exception {
- LOG.debug( "userLastNameSearch" );
+ logger.debug( "userLastNameSearch" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -405,7 +403,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testGroups() throws Exception {
- LOG.debug("testGroups");
+ logger.debug("testGroups");
EntityManager em = app.getEntityManager();
assertNotNull(em);
@@ -443,7 +441,7 @@ public class CollectionIT extends AbstractCoreIT {
Results r = em.searchCollectionConsistent( group, "users", query.withResultsLevel( Level.LINKED_PROPERTIES ),1 );
- LOG.info(JsonUtils.mapToFormattedJsonString(r.getEntities()));
+ logger.info(JsonUtils.mapToFormattedJsonString(r.getEntities()));
assertEquals(1, r.size());
assertTrue(r.getEntities().get(0).getUuid().equals(user1.getUuid()));
@@ -456,7 +454,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void groupNameSearch() throws Exception {
- LOG.debug( "groupNameSearch" );
+ logger.debug( "groupNameSearch" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -488,7 +486,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void groupTitleSearch() throws Exception {
- LOG.debug( "groupTitleSearch" );
+ logger.debug( "groupTitleSearch" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -521,7 +519,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testSubkeys() throws Exception {
- LOG.debug( "testSubkeys" );
+ logger.debug( "testSubkeys" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -566,14 +564,14 @@ public class CollectionIT extends AbstractCoreIT {
final Query query = Query.fromQL( "verb = 'post'" );
Results r = em.searchCollection(user, "activities", query);
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( 2, r.size() );
}
@Test
public void emptyQuery() throws Exception {
- LOG.debug( "emptyQuery" );
+ logger.debug( "emptyQuery" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -616,7 +614,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void emptyQueryReverse() throws Exception {
- LOG.debug( "emptyQueryReverse" );
+ logger.debug( "emptyQueryReverse" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -660,7 +658,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void orQuery() throws Exception {
- LOG.debug( "orQuery" );
+ logger.debug( "orQuery" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -739,7 +737,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void andQuery() throws Exception {
- LOG.debug( "andQuery" );
+ logger.debug( "andQuery" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -800,7 +798,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void notQuery() throws Exception {
- LOG.debug( "notQuery" );
+ logger.debug( "notQuery" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -931,7 +929,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testKeywordsOrQuery() throws Exception {
- LOG.debug( "testKeywordsOrQuery" );
+ logger.debug( "testKeywordsOrQuery" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -955,14 +953,14 @@ public class CollectionIT extends AbstractCoreIT {
Query query = Query.fromQL( "select * where keywords contains 'hot' or title contains 'hot'" );
Results r = em.searchCollection( em.getApplicationRef(), "games", query );
- LOG.info(JsonUtils.mapToFormattedJsonString(r.getEntities()));
+ logger.info(JsonUtils.mapToFormattedJsonString(r.getEntities()));
assertEquals( 3, r.size() );
}
@Test
public void testKeywordsAndQuery() throws Exception {
- LOG.debug( "testKeywordsOrQuery" );
+ logger.debug( "testKeywordsOrQuery" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -986,7 +984,7 @@ public class CollectionIT extends AbstractCoreIT {
Query query = Query.fromQL( "select * where keywords contains 'new' and title contains 'extreme'" );
Results r = em.searchCollection( em.getApplicationRef(), "games", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals(2, r.size());
assertEquals( thirdGame.getUuid(), r.getEntities().get( 0 ).getUuid() );
@@ -996,7 +994,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void pagingAfterDelete() throws Exception {
- LOG.debug( "pagingAfterDelete" );
+ logger.debug( "pagingAfterDelete" );
EntityManager em = app.getEntityManager();
@@ -1020,7 +1018,7 @@ public class CollectionIT extends AbstractCoreIT {
Results r = em.searchCollection( em.getApplicationRef(), "objects", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( initialSize, r.size() );
@@ -1080,7 +1078,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void pagingLessThanWithCriteria() throws Exception {
- LOG.debug( "pagingLessThanWithCriteria" );
+ logger.debug( "pagingLessThanWithCriteria" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1108,7 +1106,7 @@ public class CollectionIT extends AbstractCoreIT {
r = em.searchCollection( em.getApplicationRef(), "pages", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( pageSize, r.size() );
@@ -1130,7 +1128,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void pagingGreaterThanWithCriteria() throws Exception {
- LOG.debug( "pagingGreaterThanWithCriteria" );
+ logger.debug( "pagingGreaterThanWithCriteria" );
EntityManager em = app.getEntityManager();
@@ -1162,7 +1160,7 @@ public class CollectionIT extends AbstractCoreIT {
r = em.searchCollection( em.getApplicationRef(), "pages", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( pageSize, r.size() );
@@ -1187,7 +1185,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void pagingWithBoundsCriteria() throws Exception {
- LOG.debug( "pagingWithBoundsCriteria" );
+ logger.debug( "pagingWithBoundsCriteria" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1217,7 +1215,7 @@ public class CollectionIT extends AbstractCoreIT {
r = em.searchCollection( em.getApplicationRef(), "pages", query );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( pageSize, r.size() );
@@ -1240,7 +1238,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testPagingWithGetNextResults() throws Exception {
- LOG.debug( "testPagingWithGetNextResults" );
+ logger.debug( "testPagingWithGetNextResults" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1268,7 +1266,7 @@ public class CollectionIT extends AbstractCoreIT {
// check they're all the same before deletion
for ( int i = 1; i < 10; i++ ) {
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( pageSize, r.size() );
@@ -1280,7 +1278,7 @@ public class CollectionIT extends AbstractCoreIT {
assertEquals( entityId, returnedId );
}
- LOG.info( "collection loop "+i );
+ logger.info( "collection loop "+i );
r = r.getNextPageResults();
}
@@ -1296,7 +1294,7 @@ public class CollectionIT extends AbstractCoreIT {
EntityManager em = app.getEntityManager();
assertNotNull( em );
- LOG.debug( "subpropertyQuerying" );
+ logger.debug( "subpropertyQuerying" );
Map<String, Object> root = new HashMap<String, Object>();
@@ -1346,7 +1344,7 @@ public class CollectionIT extends AbstractCoreIT {
public void arrayQuerying() throws Exception {
EntityManager em = app.getEntityManager();
assertNotNull( em );
- LOG.debug( "arrayQuerying" );
+ logger.debug( "arrayQuerying" );
Map<String, Object> root = new HashMap<String, Object>();
@@ -1409,7 +1407,7 @@ public class CollectionIT extends AbstractCoreIT {
EntityManager em = app.getEntityManager();
assertNotNull( em );
- LOG.debug( "stringWithSpaces" );
+ logger.debug( "stringWithSpaces" );
Map<String, Object> props = new HashMap<String, Object>();
@@ -1432,7 +1430,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testSelectTerms() throws Exception {
- LOG.debug( "testSelectTerms" );
+ logger.debug( "testSelectTerms" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1462,7 +1460,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testRedefineTerms() throws Exception {
- LOG.debug( "testRedefineTerms" );
+ logger.debug( "testRedefineTerms" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1494,7 +1492,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testSelectEmailViaConnection() throws Exception {
- LOG.debug( "testSelectEmailViaConnection" );
+ logger.debug( "testSelectEmailViaConnection" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1549,7 +1547,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void testNotQueryAnd() throws Exception {
- LOG.debug( "testNotQueryAnd" );
+ logger.debug( "testNotQueryAnd" );
EntityManager em = app.getEntityManager();
@@ -1614,7 +1612,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void runtimeTypeCorrect() throws Exception {
- LOG.debug( "runtimeTypeCorrect" );
+ logger.debug( "runtimeTypeCorrect" );
EntityManager em = app.getEntityManager();
@@ -1638,7 +1636,7 @@ public class CollectionIT extends AbstractCoreIT {
Results r = em.getCollection( em.getApplicationRef(), "users", null, 50, Level.ALL_PROPERTIES, false );
- LOG.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
+ logger.info( JsonUtils.mapToFormattedJsonString( r.getEntities() ) );
assertEquals( size, r.size() );
@@ -1654,7 +1652,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void badOrderByBadGrammarAsc() throws Exception {
- LOG.debug( "badOrderByBadGrammarAsc" );
+ logger.debug( "badOrderByBadGrammarAsc" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1684,7 +1682,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void badOrderByBadGrammarDesc() throws Exception {
- LOG.debug( "badOrderByBadGrammarDesc" );
+ logger.debug( "badOrderByBadGrammarDesc" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1715,7 +1713,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void uuidIdentifierTest() throws Exception {
- LOG.debug( "uuidIdentifierTest" );
+ logger.debug( "uuidIdentifierTest" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1746,7 +1744,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void nameIdentifierTest() throws Exception {
- LOG.debug( "nameIdentifierTest" );
+ logger.debug( "nameIdentifierTest" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1780,7 +1778,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test
public void emailIdentifierTest() throws Exception {
- LOG.debug( "emailIdentifierTest" );
+ logger.debug( "emailIdentifierTest" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1814,7 +1812,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test( expected = DuplicateUniquePropertyExistsException.class )
public void duplicateIdentifierTest() throws Exception {
- LOG.debug( "duplicateIdentifierTest" );
+ logger.debug( "duplicateIdentifierTest" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
@@ -1836,7 +1834,7 @@ public class CollectionIT extends AbstractCoreIT {
@Test( expected = DuplicateUniquePropertyExistsException.class )
public void duplicateNameTest() throws Exception {
- LOG.debug( "duplicateNameTest" );
+ logger.debug( "duplicateNameTest" );
EntityManager em = app.getEntityManager();
assertNotNull( em );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
index e9de76e..5f8f2f2 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CoreSchemaManager.java
@@ -17,7 +17,6 @@
package org.apache.usergrid.persistence;
-import org.junit.Ignore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,7 +33,7 @@ import me.prettyprint.hector.api.Cluster;
/** @author zznate */
public class CoreSchemaManager implements SchemaManager {
- private static final Logger LOG = LoggerFactory.getLogger( CoreSchemaManager.class );
+ private static final Logger logger = LoggerFactory.getLogger( CoreSchemaManager.class );
private final Setup setup;
private final Cluster cluster;
@@ -52,7 +51,7 @@ public class CoreSchemaManager implements SchemaManager {
setup.initSubsystems();
}
catch ( Exception ex ) {
- LOG.error( "Could not setup usergrid core schema", ex );
+ logger.error( "Could not setup usergrid core schema", ex );
throw new RuntimeException( "Could not setup usergrid core schema", ex );
}
}
@@ -74,7 +73,7 @@ public class CoreSchemaManager implements SchemaManager {
}
catch ( Exception ex ) {
- LOG.error( "Could not create default applications", ex );
+ logger.error( "Could not create default applications", ex );
throw new RuntimeException("Could not create default applications", ex );
}
}
@@ -82,7 +81,7 @@ public class CoreSchemaManager implements SchemaManager {
@Override
public void destroy() {
- LOG.info( "dropping keyspaces" );
+ logger.info( "dropping keyspaces" );
try {
cluster.dropKeyspace( CassandraService.getApplicationKeyspace() );
}
@@ -98,7 +97,7 @@ public class CoreSchemaManager implements SchemaManager {
//swallow if it just doesn't exist
}
- LOG.info( "keyspaces dropped" );
+ logger.info( "keyspaces dropped" );
final EsProvider provider =
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/CounterIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CounterIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CounterIT.java
index 77dacf2..7330367 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CounterIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CounterIT.java
@@ -47,7 +47,7 @@ import static org.junit.Assert.assertNotNull;
@NotThreadSafe
public class CounterIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( CounterIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( CounterIT.class );
@Rule
public ImmediateCounterRule counterRule = new ImmediateCounterRule();
@@ -65,7 +65,7 @@ public class CounterIT extends AbstractCoreIT {
@Test
public void testIncrementAndDecrement() throws Exception {
- LOG.info( "CounterIT.testIncrementAndDecrement" );
+ logger.info( "CounterIT.testIncrementAndDecrement" );
EntityManager em = app.getEntityManager();
@@ -85,7 +85,7 @@ public class CounterIT extends AbstractCoreIT {
userProperties.put( "email", "test-email" );
User user = ( User ) em.create( uuid, "user", userProperties ).toTypedEntity();
- LOG.debug( "user={}", user );
+ logger.debug( "user={}", user );
em.refreshIndex();
@@ -103,7 +103,7 @@ public class CounterIT extends AbstractCoreIT {
@Test
public void testCounters() throws Exception {
- LOG.info( "CounterIT.testCounters" );
+ logger.info( "CounterIT.testCounters" );
EntityManager em = app.getEntityManager();
@@ -132,19 +132,19 @@ public class CounterIT extends AbstractCoreIT {
Results r = em.getAggregateCounters( null, null, null, "visits", CounterResolution.SIX_HOUR, ts,
System.currentTimeMillis(), false );
- LOG.info( JsonUtils.mapToJsonString( r.getCounters() ) );
+ logger.info( JsonUtils.mapToJsonString( r.getCounters() ) );
r = em.getAggregateCounters( user1, null, null, "visits", CounterResolution.SIX_HOUR, ts,
System.currentTimeMillis(), false );
- LOG.info( JsonUtils.mapToJsonString( r.getCounters() ) );
+ logger.info( JsonUtils.mapToJsonString( r.getCounters() ) );
r = em.getAggregateCounters( user1, null, null, "visits", CounterResolution.SIX_HOUR, ts,
System.currentTimeMillis(), true );
- LOG.info( JsonUtils.mapToJsonString( r.getCounters() ) );
+ logger.info( JsonUtils.mapToJsonString( r.getCounters() ) );
r = em.getAggregateCounters( user1, null, null, "visits", CounterResolution.ALL, ts, System.currentTimeMillis(),
false );
- LOG.info( JsonUtils.mapToJsonString( r.getCounters() ) );
+ logger.info( JsonUtils.mapToJsonString( r.getCounters() ) );
for ( int i = 0; i < 10; i++ ) {
event = new Event();
@@ -155,7 +155,7 @@ public class CounterIT extends AbstractCoreIT {
r = em.getAggregateCounters( null, null, null, "clicks", CounterResolution.HALF_HOUR, ts,
System.currentTimeMillis(), true );
- LOG.info( JsonUtils.mapToJsonString( r.getCounters() ) );
+ logger.info( JsonUtils.mapToJsonString( r.getCounters() ) );
Query query = new Query();
query.addCounterFilter( "clicks:*:*:*" );
@@ -165,13 +165,13 @@ public class CounterIT extends AbstractCoreIT {
query.setResolution( CounterResolution.SIX_HOUR );
query.setPad( true );
r = em.getAggregateCounters( query );
- LOG.info( JsonUtils.mapToJsonString( r.getCounters() ) );
+ logger.info( JsonUtils.mapToJsonString( r.getCounters() ) );
- LOG.info( JsonUtils.mapToJsonString( em.getCounterNames() ) );
+ logger.info( JsonUtils.mapToJsonString( em.getCounterNames() ) );
Map<String, Long> counts = em.getApplicationCounters();
- LOG.info( "counts map: " + JsonUtils.mapToJsonString( counts ) );
+ logger.info( "counts map: " + JsonUtils.mapToJsonString( counts ) );
assertEquals( new Long( 10 ), counts.get( "clicks" ) );
assertEquals( new Long( 200 ), counts.get( "visits" ) );
@@ -243,7 +243,7 @@ public class CounterIT extends AbstractCoreIT {
// em.create(event);
counts = em.getApplicationCounters();
- LOG.info( JsonUtils.mapToJsonString( counts ) );
+ logger.info( JsonUtils.mapToJsonString( counts ) );
assertNotNull( counts.get( "admin.logins" ) );
assertEquals( 1, counts.get( "admin.logins" ).longValue() - originalAdminLoginsCount );
@@ -254,18 +254,18 @@ public class CounterIT extends AbstractCoreIT {
Results r = em.getAggregateCounters( null, null, null, "admin.logins", CounterResolution.ALL, ts,
System.currentTimeMillis(), false );
- LOG.info( JsonUtils.mapToJsonString( r.getCounters() ) );
+ logger.info( JsonUtils.mapToJsonString( r.getCounters() ) );
assertEquals( 1, r.getCounters().get( 0 ).getValues().get( 0 ).getValue() - originalAdminLoginsCount );
r = em.getAggregateCounters( query );
- LOG.info( JsonUtils.mapToJsonString( r.getCounters() ) );
+ logger.info( JsonUtils.mapToJsonString( r.getCounters() ) );
assertEquals( 1, r.getCounters().get( 0 ).getValues().get( 0 ).getValue() - originalCount );
}
@Test
public void testTimedFlush() throws Exception {
- LOG.info( "CounterIT.testCounters" );
+ logger.info( "CounterIT.testCounters" );
EntityManager em = app.getEntityManager();
http://git-wip-us.apache.org/repos/asf/usergrid/blob/bc33c88d/stack/core/src/test/java/org/apache/usergrid/persistence/EntityConnectionsIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/EntityConnectionsIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/EntityConnectionsIT.java
index f5d3ce4..be2f06e 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/EntityConnectionsIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/EntityConnectionsIT.java
@@ -17,14 +17,12 @@
package org.apache.usergrid.persistence;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
-import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,7 +37,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class EntityConnectionsIT extends AbstractCoreIT {
- private static final Logger LOG = LoggerFactory.getLogger( EntityConnectionsIT.class );
+ private static final Logger logger = LoggerFactory.getLogger( EntityConnectionsIT.class );
public EntityConnectionsIT() {
@@ -89,49 +87,49 @@ public class EntityConnectionsIT extends AbstractCoreIT {
final UUID applicationId = app.getId();
assertNotNull( em );
- LOG.info( "\n\nCreating Cat entity A with name of Dylan\n" );
+ logger.info( "\n\nCreating Cat entity A with name of Dylan\n" );
Map<String, Object> properties = new LinkedHashMap<String, Object>();
properties.put( "name", "Dylan" );
Entity catA = em.create( "cat", properties );
assertNotNull( catA );
- LOG.info( "\n\nEntity A created with id " + catA.getUuid() + "\n" );
+ logger.info( "\n\nEntity A created with id " + catA.getUuid() + "\n" );
// Do entity get by id for id of cat entity A
- LOG.info( "\n\nLooking up cat with id " + catA.getUuid() + "\n" );
+ logger.info( "\n\nLooking up cat with id " + catA.getUuid() + "\n" );
Entity cat = em.get( catA );
assertNotNull( cat );
- LOG.info( "\n\nFound entity " + cat.getUuid() + " of type " + cat.getType() + " with name " + cat
+ logger.info( "\n\nFound entity " + cat.getUuid() + " of type " + cat.getType() + " with name " + cat
.getProperty( "name" ) + "\n" );
// Create cat entity B
- LOG.info( "\n\nCreating cat entity B with name of Nico\n" );
+ logger.info( "\n\nCreating cat entity B with name of Nico\n" );
properties = new LinkedHashMap<String, Object>();
properties.put( "name", "Nico" );
Entity catB = em.create( "cat", properties );
assertNotNull( catB );
- LOG.info( "\n\nEntity B created with id " + catB.getUuid() + "\n" );
+ logger.info( "\n\nEntity B created with id " + catB.getUuid() + "\n" );
// Create award entity A
- LOG.info( "\n\nCreating award entity with name of 'best cat'\n" );
+ logger.info( "\n\nCreating award entity with name of 'best cat'\n" );
properties = new LinkedHashMap<String, Object>();
properties.put( "name", "Best Cat Ever" );
Entity awardA = em.create( "award", properties );
assertNotNull( awardA );
- LOG.info( "\n\nEntity created with id " + awardA.getUuid() + "\n" );
+ logger.info( "\n\nEntity created with id " + awardA.getUuid() + "\n" );
// Establish connection from cat A to cat B
- LOG.info( "\n\nConnecting " + catA.getUuid() + " \"likes\" " + catB.getUuid() + "\n" );
+ logger.info( "\n\nConnecting " + catA.getUuid() + " \"likes\" " + catB.getUuid() + "\n" );
em.createConnection( catA, "likes", catB );
// Establish connection from award A to cat B
- LOG.info( "\n\nConnecting " + awardA.getUuid() + " \"awarded\" " + catB.getUuid() + "\n" );
+ logger.info( "\n\nConnecting " + awardA.getUuid() + " \"awarded\" " + catB.getUuid() + "\n" );
em.createConnection( awardA, "awarded", catB );
app.refreshIndex();
@@ -140,19 +138,19 @@ public class EntityConnectionsIT extends AbstractCoreIT {
// Thread.sleep(5000);
- LOG.info( "Find all connections for cat A: " + catA.getUuid() );
+ logger.info( "Find all connections for cat A: " + catA.getUuid() );
testEntityConnections( applicationId, catA.getUuid(), "likes", "cat", 1 );
// List forward connections for award A
- LOG.info( "Find all connections for award A: " + awardA.getUuid() );
+ logger.info( "Find all connections for award A: " + awardA.getUuid() );
testEntityConnections( applicationId, awardA.getUuid(),"awarded", "award", 1 );
// Establish connection from award A to cat A
- LOG.info( "\n\nConnecting " + awardA.getUuid() + " \"awarded\" " + catA.getUuid() + "\n" );
+ logger.info( "\n\nConnecting " + awardA.getUuid() + " \"awarded\" " + catA.getUuid() + "\n" );
em.createConnection( awardA, "awarded", catA );
app.refreshIndex();
@@ -173,22 +171,22 @@ public class EntityConnectionsIT extends AbstractCoreIT {
testApplicationCollections( applicationId, "awards", 1 );
- LOG.info( "\n\nSearching Award A for recipients with the name Dylan\n" );
+ logger.info( "\n\nSearching Award A for recipients with the name Dylan\n" );
}
public Map<String, Map<String, List<UUID>>> testEntityConnections(
UUID applicationId, UUID entityId, String connectionType, String entityType, int expectedCount ) throws Exception {
- LOG.info( "----------------------------------------------------" );
- LOG.info( "Checking connections for " + entityId.toString() );
+ logger.info( "----------------------------------------------------" );
+ logger.info( "Checking connections for " + entityId.toString() );
EntityManager em = setup.getEmf().getEntityManager( applicationId );
Entity en = em.get( new SimpleEntityRef( entityType, entityId));
Results results = em.getTargetEntities(en, connectionType, null, Level.REFS);
- LOG.info( "----------------------------------------------------" );
+ logger.info( "----------------------------------------------------" );
assertEquals( "Expected " + expectedCount + " connections",
expectedCount, results.getConnections().size() );
// return connections;
@@ -207,8 +205,8 @@ public class EntityConnectionsIT extends AbstractCoreIT {
public List<UUID> testEntityCollections( UUID applicationId, UUID entityId, String entityType,
String collectionName, int expectedCount ) throws Exception {
- LOG.info( "----------------------------------------------------" );
- LOG.info( "Checking collection " + collectionName + " for " + entityId.toString() );
+ logger.info( "----------------------------------------------------" );
+ logger.info( "Checking collection " + collectionName + " for " + entityId.toString() );
EntityManager em = setup.getEmf().getEntityManager( applicationId );
Entity en = em.get( new SimpleEntityRef( entityType, entityId ));
@@ -216,9 +214,9 @@ public class EntityConnectionsIT extends AbstractCoreIT {
int i = 0;
Results entities = em.getCollection( en, collectionName, null, 100, Level.IDS, false );
for ( UUID id : entities.getIds() ) {
- LOG.info( ( i++ ) + " " + id.toString() );
+ logger.info( ( i++ ) + " " + id.toString() );
}
- LOG.info( "----------------------------------------------------" );
+ logger.info( "----------------------------------------------------" );
assertEquals( "Expected " + expectedCount + " connections", expectedCount,
entities.getIds() != null ? entities.getIds().size() : 0 );
// return connections;
[7/7] usergrid git commit: Merge commit 'refs/pull/458/head' of
github.com:apache/usergrid
Posted by mr...@apache.org.
Merge commit 'refs/pull/458/head' of github.com:apache/usergrid
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/63091f34
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/63091f34
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/63091f34
Branch: refs/heads/master
Commit: 63091f3497cede3fab597fbad44e86ee13ddabe1
Parents: 5034844 000e1ce
Author: Michael Russo <mi...@gmail.com>
Authored: Fri Jan 8 09:20:47 2016 -0800
Committer: Michael Russo <mi...@gmail.com>
Committed: Fri Jan 8 09:20:47 2016 -0800
----------------------------------------------------------------------
.../batch/service/JobSchedulerService.java | 55 +++++----
.../batch/service/SchedulerServiceImpl.java | 30 ++---
.../usergrid/count/Slf4JBatchSubmitter.java | 6 +-
.../org/apache/usergrid/utils/MapUtils.java | 2 +-
.../org/apache/usergrid/utils/UUIDUtils.java | 5 +-
.../org/apache/usergrid/AbstractCoreIT.java | 6 +-
.../org/apache/usergrid/CoreApplication.java | 11 +-
.../org/apache/usergrid/CoreITSetupImpl.java | 12 +-
.../usergrid/batch/job/TestJobListenerTest.java | 6 +-
.../count/BatchCountParallelismTest.java | 11 +-
.../locking/cassandra/HectorLockManagerIT.java | 10 +-
.../SingleNodeLockTestSingleNode.java | 10 +-
.../java/org/apache/usergrid/mq/MessagesIT.java | 62 +++++-----
.../org/apache/usergrid/mq/QueuePathsTest.java | 18 +--
.../usergrid/persistence/CollectionIT.java | 118 +++++++++----------
.../usergrid/persistence/CoreSchemaManager.java | 11 +-
.../apache/usergrid/persistence/CounterIT.java | 32 ++---
.../persistence/EntityConnectionsIT.java | 46 ++++----
.../persistence/EntityDictionaryIT.java | 24 ++--
.../usergrid/persistence/EntityManagerIT.java | 76 ++++++------
.../org/apache/usergrid/persistence/GeoIT.java | 21 ++--
.../persistence/GeoQueryBooleanTest.java | 7 +-
.../apache/usergrid/persistence/IndexIT.java | 43 +++----
.../apache/usergrid/persistence/SchemaTest.java | 18 +--
.../query/IntersectionTransitivePagingIT.java | 4 +-
.../query/IntersectionUnionPagingIT.java | 12 +-
.../persistence/query/IteratingQueryIT.java | 104 ++++++++--------
.../persistence/query/NotSubPropertyIT.java | 8 +-
.../apache/usergrid/utils/IndexUtilsTest.java | 6 +-
.../apache/usergrid/utils/JsonUtilsTest.java | 4 +-
.../apache/usergrid/utils/ListUtilsTest.java | 6 +-
.../org/apache/usergrid/utils/MapUtilsTest.java | 6 +-
.../apache/usergrid/utils/TestInflector.java | 6 +-
.../EntityCollectionManagerStressTest.java | 9 +-
.../changelog/ChangeLogGeneratorImplTest.java | 8 +-
.../stage/write/WriteOptimisticVerifyTest.java | 4 +-
.../migration/data/AbstractMigrationPlugin.java | 6 +-
.../persistence/core/astyanax/TestUtils.java | 6 +-
.../persistence/core/rx/OrderedMergeTest.java | 38 +++---
.../graph/impl/stage/EdgeDeleteRepairImpl.java | 12 +-
.../shard/impl/NodeShardAllocationImpl.java | 14 +--
.../shard/impl/ShardGroupCompactionImpl.java | 30 +++--
.../persistence/graph/GraphManagerLoadTest.java | 11 +-
.../graph/GraphManagerShardConsistencyIT.java | 35 +++---
.../graph/GraphManagerStressTest.java | 10 +-
.../graph/impl/NodeDeleteListenerTest.java | 6 +-
.../serialization/EdgeSerializationTest.java | 5 +-
.../graph/serialization/TestCount.java | 4 +-
.../persistence/index/impl/EntityIndexTest.java | 12 +-
.../usergrid/launcher/EmbeddedServerHelper.java | 10 +-
.../apache/usergrid/rest/PartialUpdateTest.java | 8 +-
.../org/apache/usergrid/rest/TomcatRuntime.java | 12 +-
.../applications/assets/AssetResourceIT.java | 10 +-
.../applications/assets/AwsAssetResourceIT.java | 12 +-
.../collection/users/UserResourceIT.java | 13 +-
.../users/extensions/TestResource.java | 5 +-
.../applications/queries/AndOrQueryTest.java | 6 +-
.../rest/applications/queries/OrderByTest.java | 8 +-
.../applications/queries/QueryTestBase.java | 4 +-
.../services/notifications/JobScheduler.java | 9 +-
.../notifications/NotificationsService.java | 12 +-
.../services/notifications/QueueListener.java | 52 ++++----
.../services/notifications/TaskManager.java | 43 +++----
.../impl/ApplicationQueueManagerImpl.java | 80 ++++++-------
.../services/notifications/wns/WNSAdapter.java | 6 +-
.../usergrid/services/queues/QueueListener.java | 35 +++---
.../org/apache/usergrid/NewOrgAppAdminRule.java | 4 +-
.../org/apache/usergrid/ServiceApplication.java | 14 +--
.../apache/usergrid/management/EmailFlowIT.java | 22 ++--
.../org/apache/usergrid/management/RoleIT.java | 8 +-
.../cassandra/ManagementServiceIT.java | 12 +-
.../security/tokens/TokenServiceIT.java | 10 +-
.../usergrid/services/ServiceInvocationIT.java | 4 +-
.../java/org/apache/usergrid/TomcatMain.java | 10 +-
.../usergrid/cassandra/AvailablePortFinder.java | 18 +--
.../usergrid/cassandra/CassandraResource.java | 6 +-
.../usergrid/cassandra/ClearShiroSubject.java | 8 +-
.../usergrid/cassandra/SpringResource.java | 10 +-
.../usergrid/cassandra/SpringResourceTest.java | 10 +-
.../apache/usergrid/tools/WarehouseExport.java | 18 +--
.../apache/usergrid/tools/WarehouseUpsert.java | 30 ++---
.../websocket/WebSocketChannelHandler.java | 16 +--
82 files changed, 742 insertions(+), 789 deletions(-)
----------------------------------------------------------------------