[GitHub] incubator-omid pull request #23: [OMID-89] Fix metrics in Persistence proces...

2018-03-04 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-omid/pull/23


---


[GitHub] incubator-omid pull request #23: [OMID-89] Fix metrics in Persistence proces...

2018-02-13 Thread ohadshacham
Github user ohadshacham commented on a diff in the pull request:

https://github.com/apache/incubator-omid/pull/23#discussion_r167857492
  
--- Diff: 
tso-server/src/test/java/org/apache/omid/tso/TestPersistenceProcessorHandler.java
 ---
@@ -126,6 +126,36 @@ void afterMethod() {
 Mockito.reset(mockWriter);
 }
 
+@Test(timeOut = 1_000)
+public void testPersistentProcessorHandlerIdsAreCreatedConsecutive() 
throws Exception {
+
+TSOServerConfig tsoConfig = new TSOServerConfig();
+tsoConfig.setNumConcurrentCTWriters(32);
+
+PersistenceProcessorHandler[] handlers = new 
PersistenceProcessorHandler[tsoConfig.getNumConcurrentCTWriters()];
+for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
+handlers[i] = new PersistenceProcessorHandler(metrics,
+  "localhost:1234",
+  
mock(LeaseManager.class),
+  commitTable,
+  
mock(ReplyProcessor.class),
+  retryProcessor,
+  panicker);
+}
+
+for (int i = 0; i < tsoConfig.getNumConcurrentCTWriters(); i++) {
+// Required to generalize the cases when other tests have 
increased the static variable assigning the ids
+if (i + 1 < tsoConfig.getNumConcurrentCTWriters()) {
+int followingHandlerIdAsInt = Integer.valueOf(handlers[i + 
1].getId());
+assertEquals(handlers[i].getId(), 
String.valueOf(followingHandlerIdAsInt - 1));
--- End diff --

We kind of testing the atomic integer :)


---


[GitHub] incubator-omid pull request #23: [OMID-89] Fix metrics in Persistence proces...

2018-02-02 Thread francisco-perez-sorrosal
GitHub user francisco-perez-sorrosal opened a pull request:

https://github.com/apache/incubator-omid/pull/23

[OMID-89] Fix metrics in Persistence processor handlers

Change-Id: Ieb6cdf5d47cb113ea6cc8e9799bfbdef20b66565

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/francisco-perez-sorrosal/incubator-omid 
omid-89

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-omid/pull/23.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #23


commit 7a25b91b4401704d9a7b6cdf38c6dc7cd196b4e7
Author: Francisco Perez-Sorrosal 
Date:   2018-02-02T23:09:02Z

[OMID-89] Fix metrics in Persistence processsor handlers

Change-Id: Ieb6cdf5d47cb113ea6cc8e9799bfbdef20b66565




---