[GitHub] incubator-eagle pull request #566: EAGLE-683: Improve metadata store perform...

2016-10-28 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-eagle/pull/566


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-eagle pull request #566: EAGLE-683: Improve metadata store perform...

2016-10-28 Thread RalphSu
Github user RalphSu commented on a diff in the pull request:

https://github.com/apache/incubator-eagle/pull/566#discussion_r85466419
  
--- Diff: 
eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MongoMetadataDaoImpl.java
 ---
@@ -89,10 +92,37 @@
 @Inject
 public MongoMetadataDaoImpl(Config config) {
 this.connection = config.getString("connection");
+this.cappedSize = config.hasPath("cappedSize") ? 
config.getInt("cappedSize") : 0;
--- End diff --

cappedSize default as 0? why not set it some reasonable value, and i saw 
this is set as size in byte.  should it be better to control the size in 
document number. please check the maxDocuments in CreateCollectionOptions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-eagle pull request #566: EAGLE-683: Improve metadata store perform...

2016-10-28 Thread RalphSu
Github user RalphSu commented on a diff in the pull request:

https://github.com/apache/incubator-eagle/pull/566#discussion_r85466631
  
--- Diff: 
eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MongoMetadataDaoImpl.java
 ---
@@ -127,41 +157,41 @@ private void init() {
 BsonDocument doc1 = new BsonDocument();
 IndexOptions io1 = new 
IndexOptions().background(true).name("versionIndex");
 doc1.append("version", new BsonInt32(1));
-scheduleStates = db.getCollection("schedule_specs");
+scheduleStates = getCollection("schedule_specs");
 scheduleStates.createIndex(doc1, io1);
 
-spoutSpecs = db.getCollection("spoutSpecs");
+spoutSpecs = getCollection("spoutSpecs");
 {
 IndexOptions ioInternal = new 
IndexOptions().background(true).name("topologyIdIndex");
 BsonDocument docInternal = new BsonDocument();
 docInternal.append("topologyId", new BsonInt32(1));
 spoutSpecs.createIndex(docInternal, ioInternal);
 }
 
-alertSpecs = db.getCollection("alertSpecs");
+alertSpecs = getCollection("alertSpecs");
 {
 IndexOptions ioInternal = new 
IndexOptions().background(true).name("topologyNameIndex");
 BsonDocument docInternal = new BsonDocument();
 docInternal.append("topologyName", new BsonInt32(1));
 alertSpecs.createIndex(docInternal, ioInternal);
 }
 
-groupSpecs = db.getCollection("groupSpecs");
+groupSpecs = getCollection("groupSpecs");
--- End diff --

The getCollection method will make all the collection as capped. Capped 
should only apply for collections that related to schedule specs that listed on 
the jira. Please make sure the impact of the code change. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---