usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [2/2] usergrid git commit: more exception monitoring + merge
Date Tue, 13 Oct 2015 21:35:45 GMT
more exception monitoring + merge


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/298f0d8b
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/298f0d8b
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/298f0d8b

Branch: refs/heads/remove-inmemory-event-service
Commit: 298f0d8b833e0c3b0e564690e4358fd4041c46ec
Parents: 32d35e7 dbf37e4
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Tue Oct 13 15:35:31 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Tue Oct 13 15:35:31 2015 -0600

----------------------------------------------------------------------
 .../asyncevents/AmazonAsyncEventService.java    | 16 ++++++------
 .../core/rx/ExceptionBehaviorTest.java          | 26 ++++++++++++++++++++
 .../index/impl/IndexRefreshCommandImpl.java     | 15 +----------
 3 files changed, 35 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/298f0d8b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
----------------------------------------------------------------------
diff --cc stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
index 0fef974,95126c6..757e3a0
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
@@@ -279,7 -279,7 +279,8 @@@ public class AmazonAsyncEventService im
                  }
  
                  try {
-                     //check for empty sets
++
+                     //check for empty sets if this is true
                      boolean validateEmptySets = true;
                      Observable<IndexOperationMessage> indexoperationObservable;
                      //merge each operation to a master observable;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/298f0d8b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/ExceptionBehaviorTest.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/ExceptionBehaviorTest.java
index cb39ca1,cb39ca1..7eebc6e
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/ExceptionBehaviorTest.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/ExceptionBehaviorTest.java
@@@ -27,6 -27,6 +27,7 @@@ import rx.schedulers.Schedulers
  
  import java.util.ArrayList;
  import java.util.List;
++import java.util.stream.Collectors;
  
  
  /**
@@@ -71,6 -71,6 +72,31 @@@ public class ExceptionBehaviorTest 
          Assert.assertEquals(listReturn,new ArrayList<Integer>());
      }
  
++    @Test()
++    public void testSequence3(){
++        ArrayList listReturn =  Observable.range(0, 2)
++            .collect(()->new ArrayList(),(list,i) ->{
++                list.add(i);
++            }).toBlocking().first();
++
++        Assert.assertEquals(listReturn, Observable.range(0, 2).toList().toBlocking().last());
++    }
++
++    @Test(expected = TestException.class)
++    public void testStreamException(){
++        List<Integer> listReturn = new ArrayList<Integer>();
++        listReturn.add(0);
++        listReturn.add(1);
++        listReturn.add(2);
++        listReturn.stream().map(i->{
++            if(i%2 == 0){
++                throw new TestException("test");
++            }
++            return i * 2;
++        }).collect(Collectors.toList());
++       Assert.fail("test");
++    }
++
  //
  //    /**
  //     * This shows that no re-throw happens on subscribe.  This is as designed, but not
as expected

http://git-wip-us.apache.org/repos/asf/usergrid/blob/298f0d8b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
index 04f8652,087eefe..bd67fb6
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
@@@ -55,28 -55,28 +55,15 @@@ import rx.Observable
  public class IndexRefreshCommandImpl implements IndexRefreshCommand {
      private static final Logger logger = LoggerFactory.getLogger( IndexRefreshCommandImpl.class
);
  
--    private final IndexCache indexCache;
      private final EsProvider esProvider;
--    private final IndexProducer producer;
--    private final IndexFig indexFig;
      private final Timer timer;
  
  
      @Inject
--    public IndexRefreshCommandImpl(
--                                    final EsProvider esProvider,
--                                    final IndexProducer producer,
--                                    final IndexFig indexFig,
-                      l               final MetricsFactory metricsFactory,
 -                                    final MetricsFactory metricsFactory,
--                                    final IndexCache indexCache ) {
--
++    public IndexRefreshCommandImpl( final EsProvider esProvider,final MetricsFactory metricsFactory)
{
  
          this.timer = metricsFactory.getTimer( IndexRefreshCommandImpl.class, "index.refresh"
);
--
          this.esProvider = esProvider;
--        this.producer = producer;
--        this.indexFig = indexFig;
--        this.indexCache = indexCache;
      }
  
  


Mime
View raw message