[21/50] [abbrv] incubator-nifi git commit: NIFI-724: Ensure that bulletins generated for reporting tasks and controller services are shown at Controller level as well as component level

2015-07-16 Thread mcgilman
NIFI-724: Ensure that bulletins generated for reporting tasks and controller 
services are shown at Controller level as well as component level


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

Branch: refs/heads/master
Commit: e7c0461b15bff045d68e7ae8814eda2073cba209
Parents: 59aa8ff
Author: Mark Payne marka...@hotmail.com
Authored: Wed Jul 1 12:54:18 2015 -0400
Committer: Mark Payne marka...@hotmail.com
Committed: Wed Jul 1 12:54:18 2015 -0400

--
 .../nifi/events/VolatileBulletinRepository.java | 105 ++-
 1 file changed, 78 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e7c0461b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
--
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
index c18fffd..8aeb34d 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
@@ -36,6 +36,8 @@ public class VolatileBulletinRepository implements 
BulletinRepository {
 private static final int CONTROLLER_BUFFER_SIZE = 10;
 private static final int COMPONENT_BUFFER_SIZE = 5;
 private static final String CONTROLLER_BULLETIN_STORE_KEY = CONTROLLER;
+private static final String SERVICE_BULLETIN_STORE_KEY = SERVICE;
+private static final String REPORTING_TASK_BULLETIN_STORE_KEY = 
REPORTING_TASK;
 
 private final ConcurrentMapString, ConcurrentMapString, 
RingBufferBulletin bulletinStoreMap = new ConcurrentHashMap();
 private volatile BulletinProcessingStrategy processingStrategy = new 
DefaultBulletinProcessingStrategy();
@@ -170,18 +172,39 @@ public class VolatileBulletinRepository implements 
BulletinRepository {
 public ListBulletin findBulletinsForController(final int max) {
 final long fiveMinutesAgo = System.currentTimeMillis() - 
TimeUnit.MINUTES.toMillis(5);
 
-final ConcurrentMapString, RingBufferBulletin componentMap = 
bulletinStoreMap.get(CONTROLLER_BULLETIN_STORE_KEY);
-if (componentMap == null) {
-return Collections.BulletinemptyList();
-}
-
-final RingBufferBulletin buffer = 
componentMap.get(CONTROLLER_BULLETIN_STORE_KEY);
-return buffer == null ? Collections.BulletinemptyList() : 
buffer.getSelectedElements(new FilterBulletin() {
+final FilterBulletin filter = new FilterBulletin() {
 @Override
 public boolean select(final Bulletin bulletin) {
 return bulletin.getTimestamp().getTime() = fiveMinutesAgo;
 }
-}, max);
+};
+
+final ListBulletin controllerBulletins = new ArrayList();
+
+final ConcurrentMapString, RingBufferBulletin 
controllerBulletinMap = bulletinStoreMap.get(CONTROLLER_BULLETIN_STORE_KEY);
+if (controllerBulletinMap != null) {
+final RingBufferBulletin buffer = 
controllerBulletinMap.get(CONTROLLER_BULLETIN_STORE_KEY);
+if (buffer != null) {
+controllerBulletins.addAll(buffer.getSelectedElements(filter, 
max));
+}
+}
+
+for (final String key : new String[] { SERVICE_BULLETIN_STORE_KEY, 
REPORTING_TASK_BULLETIN_STORE_KEY }) {
+final ConcurrentMapString, RingBufferBulletin bulletinMap = 
bulletinStoreMap.get(key);
+if (bulletinMap != null) {
+for (final RingBufferBulletin buffer : bulletinMap.values()) 
{
+
controllerBulletins.addAll(buffer.getSelectedElements(filter, max));
+}
+}
+}
+
+// We only want the newest bulletin, so we sort based on time and take 
the top 'max' entries
+Collections.sort(controllerBulletins);
+if (controllerBulletins.size()  max) {
+return controllerBulletins.subList(0, max);
+}
+
+return controllerBulletins;
 }
 
 /**
@@ -203,7 +226,7 @@ public class VolatileBulletinRepository implements 
BulletinRepository {
 this.processingStrategy = new 

[06/10] incubator-nifi git commit: NIFI-724: Ensure that bulletins generated for reporting tasks and controller services are shown at Controller level as well as component level

2015-07-02 Thread mcgilman
NIFI-724: Ensure that bulletins generated for reporting tasks and controller 
services are shown at Controller level as well as component level


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

Branch: refs/heads/develop
Commit: e7c0461b15bff045d68e7ae8814eda2073cba209
Parents: 59aa8ff
Author: Mark Payne marka...@hotmail.com
Authored: Wed Jul 1 12:54:18 2015 -0400
Committer: Mark Payne marka...@hotmail.com
Committed: Wed Jul 1 12:54:18 2015 -0400

--
 .../nifi/events/VolatileBulletinRepository.java | 105 ++-
 1 file changed, 78 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e7c0461b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
--
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
index c18fffd..8aeb34d 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
@@ -36,6 +36,8 @@ public class VolatileBulletinRepository implements 
BulletinRepository {
 private static final int CONTROLLER_BUFFER_SIZE = 10;
 private static final int COMPONENT_BUFFER_SIZE = 5;
 private static final String CONTROLLER_BULLETIN_STORE_KEY = CONTROLLER;
+private static final String SERVICE_BULLETIN_STORE_KEY = SERVICE;
+private static final String REPORTING_TASK_BULLETIN_STORE_KEY = 
REPORTING_TASK;
 
 private final ConcurrentMapString, ConcurrentMapString, 
RingBufferBulletin bulletinStoreMap = new ConcurrentHashMap();
 private volatile BulletinProcessingStrategy processingStrategy = new 
DefaultBulletinProcessingStrategy();
@@ -170,18 +172,39 @@ public class VolatileBulletinRepository implements 
BulletinRepository {
 public ListBulletin findBulletinsForController(final int max) {
 final long fiveMinutesAgo = System.currentTimeMillis() - 
TimeUnit.MINUTES.toMillis(5);
 
-final ConcurrentMapString, RingBufferBulletin componentMap = 
bulletinStoreMap.get(CONTROLLER_BULLETIN_STORE_KEY);
-if (componentMap == null) {
-return Collections.BulletinemptyList();
-}
-
-final RingBufferBulletin buffer = 
componentMap.get(CONTROLLER_BULLETIN_STORE_KEY);
-return buffer == null ? Collections.BulletinemptyList() : 
buffer.getSelectedElements(new FilterBulletin() {
+final FilterBulletin filter = new FilterBulletin() {
 @Override
 public boolean select(final Bulletin bulletin) {
 return bulletin.getTimestamp().getTime() = fiveMinutesAgo;
 }
-}, max);
+};
+
+final ListBulletin controllerBulletins = new ArrayList();
+
+final ConcurrentMapString, RingBufferBulletin 
controllerBulletinMap = bulletinStoreMap.get(CONTROLLER_BULLETIN_STORE_KEY);
+if (controllerBulletinMap != null) {
+final RingBufferBulletin buffer = 
controllerBulletinMap.get(CONTROLLER_BULLETIN_STORE_KEY);
+if (buffer != null) {
+controllerBulletins.addAll(buffer.getSelectedElements(filter, 
max));
+}
+}
+
+for (final String key : new String[] { SERVICE_BULLETIN_STORE_KEY, 
REPORTING_TASK_BULLETIN_STORE_KEY }) {
+final ConcurrentMapString, RingBufferBulletin bulletinMap = 
bulletinStoreMap.get(key);
+if (bulletinMap != null) {
+for (final RingBufferBulletin buffer : bulletinMap.values()) 
{
+
controllerBulletins.addAll(buffer.getSelectedElements(filter, max));
+}
+}
+}
+
+// We only want the newest bulletin, so we sort based on time and take 
the top 'max' entries
+Collections.sort(controllerBulletins);
+if (controllerBulletins.size()  max) {
+return controllerBulletins.subList(0, max);
+}
+
+return controllerBulletins;
 }
 
 /**
@@ -203,7 +226,7 @@ public class VolatileBulletinRepository implements 
BulletinRepository {
 this.processingStrategy = new 

incubator-nifi git commit: NIFI-724: Ensure that bulletins generated for reporting tasks and controller services are shown at Controller level as well as component level

2015-07-01 Thread markap14
Repository: incubator-nifi
Updated Branches:
  refs/heads/NIFI-724 59aa8ffe1 - e7c0461b1


NIFI-724: Ensure that bulletins generated for reporting tasks and controller 
services are shown at Controller level as well as component level


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

Branch: refs/heads/NIFI-724
Commit: e7c0461b15bff045d68e7ae8814eda2073cba209
Parents: 59aa8ff
Author: Mark Payne marka...@hotmail.com
Authored: Wed Jul 1 12:54:18 2015 -0400
Committer: Mark Payne marka...@hotmail.com
Committed: Wed Jul 1 12:54:18 2015 -0400

--
 .../nifi/events/VolatileBulletinRepository.java | 105 ++-
 1 file changed, 78 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e7c0461b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
--
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
index c18fffd..8aeb34d 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/events/VolatileBulletinRepository.java
@@ -36,6 +36,8 @@ public class VolatileBulletinRepository implements 
BulletinRepository {
 private static final int CONTROLLER_BUFFER_SIZE = 10;
 private static final int COMPONENT_BUFFER_SIZE = 5;
 private static final String CONTROLLER_BULLETIN_STORE_KEY = CONTROLLER;
+private static final String SERVICE_BULLETIN_STORE_KEY = SERVICE;
+private static final String REPORTING_TASK_BULLETIN_STORE_KEY = 
REPORTING_TASK;
 
 private final ConcurrentMapString, ConcurrentMapString, 
RingBufferBulletin bulletinStoreMap = new ConcurrentHashMap();
 private volatile BulletinProcessingStrategy processingStrategy = new 
DefaultBulletinProcessingStrategy();
@@ -170,18 +172,39 @@ public class VolatileBulletinRepository implements 
BulletinRepository {
 public ListBulletin findBulletinsForController(final int max) {
 final long fiveMinutesAgo = System.currentTimeMillis() - 
TimeUnit.MINUTES.toMillis(5);
 
-final ConcurrentMapString, RingBufferBulletin componentMap = 
bulletinStoreMap.get(CONTROLLER_BULLETIN_STORE_KEY);
-if (componentMap == null) {
-return Collections.BulletinemptyList();
-}
-
-final RingBufferBulletin buffer = 
componentMap.get(CONTROLLER_BULLETIN_STORE_KEY);
-return buffer == null ? Collections.BulletinemptyList() : 
buffer.getSelectedElements(new FilterBulletin() {
+final FilterBulletin filter = new FilterBulletin() {
 @Override
 public boolean select(final Bulletin bulletin) {
 return bulletin.getTimestamp().getTime() = fiveMinutesAgo;
 }
-}, max);
+};
+
+final ListBulletin controllerBulletins = new ArrayList();
+
+final ConcurrentMapString, RingBufferBulletin 
controllerBulletinMap = bulletinStoreMap.get(CONTROLLER_BULLETIN_STORE_KEY);
+if (controllerBulletinMap != null) {
+final RingBufferBulletin buffer = 
controllerBulletinMap.get(CONTROLLER_BULLETIN_STORE_KEY);
+if (buffer != null) {
+controllerBulletins.addAll(buffer.getSelectedElements(filter, 
max));
+}
+}
+
+for (final String key : new String[] { SERVICE_BULLETIN_STORE_KEY, 
REPORTING_TASK_BULLETIN_STORE_KEY }) {
+final ConcurrentMapString, RingBufferBulletin bulletinMap = 
bulletinStoreMap.get(key);
+if (bulletinMap != null) {
+for (final RingBufferBulletin buffer : bulletinMap.values()) 
{
+
controllerBulletins.addAll(buffer.getSelectedElements(filter, max));
+}
+}
+}
+
+// We only want the newest bulletin, so we sort based on time and take 
the top 'max' entries
+Collections.sort(controllerBulletins);
+if (controllerBulletins.size()  max) {
+return controllerBulletins.subList(0, max);
+}
+
+return controllerBulletins;
 }
 
 /**
@@ -203,7 +226,7 @@ public class