Author: burn
Date: Fri Jan 18 20:08:20 2019
New Revision: 1851641

URL: http://svn.apache.org/viewvc?rev=1851641&view=rev
Log:
UIMA-5965 Remove unused imports & use Thread.sleep

Modified:
    
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/ServiceConfiguration.java
    
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/main/PullService.java
    
uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/service/JunitPullServiceTestCase.java
    
uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/test/ae/NoOpAE.java

Modified: 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/ServiceConfiguration.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/ServiceConfiguration.java?rev=1851641&r1=1851640&r2=1851641&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/ServiceConfiguration.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/ServiceConfiguration.java
 Fri Jan 18 20:08:20 2019
@@ -19,8 +19,6 @@
 
 package org.apache.uima.ducc.ps.service;
 
-import java.util.List;
-
 import org.apache.uima.ducc.ps.service.errors.ServiceInitializationException;
 
 public class ServiceConfiguration {
@@ -259,7 +257,7 @@ public class ServiceConfiguration {
                }
                if ( System.getProperty("ducc.deploy.JpFlowController") != null 
) {
                        
setJpFlowController(System.getProperty("ducc.deploy.JpFlowController"));
-               }       
+               }
            if ( System.getProperty("ducc.deploy.JpCmDescriptor") != null ) {
                         
setCmDescriptor(System.getProperty("ducc.deploy.JpCmDescriptor"));
                }
@@ -280,10 +278,10 @@ public class ServiceConfiguration {
                }
 /*
                List<String> cmOverrides = 
getPropertyListString("ducc.deploy.JpCmOverrides");
-                 List<String> aeOverrides = 
getPropertyListString("ducc.deploy.JpAeOverrides"); 
+                 List<String> aeOverrides = 
getPropertyListString("ducc.deploy.JpAeOverrides");
                  List<String> ccOverrides = 
getPropertyListString("ducc.deploy.JpCcOverrides");
-*/             
-               
+*/
+
                serviceJmxConnectURL = System.getProperty("ducc.jmx.port");
                customRegistryClass = 
System.getProperty("ducc.deploy.registry.class");
                customProcessorClass = 
System.getProperty("ducc.deploy.custom.processor.class");
@@ -292,7 +290,7 @@ public class ServiceConfiguration {
                if ( getJobId() == null ) {
                        setJobId(System.getenv("DUCC_JOBID"));
                }
-               
+
                duccProcessId = System.getenv("DUCC_PROCESSID");
                duccProcessUniqueId = System.getenv("DUCC_PROCESS_UNIQUEID");
                monitorPort = System.getenv("DUCC_STATE_UPDATE_PORT");

Modified: 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/main/PullService.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/main/PullService.java?rev=1851641&r1=1851640&r2=1851641&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/main/PullService.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/main/java/org/apache/uima/ducc/ps/service/main/PullService.java
 Fri Jan 18 20:08:20 2019
@@ -44,7 +44,6 @@ import org.apache.uima.ducc.ps.service.p
 import org.apache.uima.ducc.ps.service.protocol.IServiceProtocolHandler;
 import 
org.apache.uima.ducc.ps.service.protocol.builtin.DefaultNoTaskAvailableStrategy;
 import 
org.apache.uima.ducc.ps.service.protocol.builtin.DefaultServiceProtocolHandler;
-import org.apache.uima.ducc.ps.service.protocol.builtin.NoWaitStrategy;
 import org.apache.uima.ducc.ps.service.registry.DefaultRegistryClient;
 import org.apache.uima.ducc.ps.service.registry.IRegistryClient;
 import org.apache.uima.ducc.ps.service.transport.IServiceTransport;
@@ -186,7 +185,7 @@ public class PullService implements ISer
                        // this down just before thread dies.
                        CountDownLatch stopLatch = new CountDownLatch(scaleout);
                        serviceProcessor.setScaleout(scaleout);
-                       INoTaskAvailableStrategy waitStrategy = 
+                       INoTaskAvailableStrategy waitStrategy =
                                        new 
DefaultNoTaskAvailableStrategy(waitTimeInMillis);
                        // add default protocol handler
                protocolHandler =

Modified: 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/service/JunitPullServiceTestCase.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/service/JunitPullServiceTestCase.java?rev=1851641&r1=1851640&r2=1851641&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/service/JunitPullServiceTestCase.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/service/JunitPullServiceTestCase.java
 Fri Jan 18 20:08:20 2019
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,10 +24,7 @@ import java.util.concurrent.CountDownLat
 
 import org.apache.uima.ducc.ps.Client;
 import org.apache.uima.ducc.ps.service.builders.PullServiceStepBuilder;
-import org.apache.uima.ducc.ps.service.errors.IServiceErrorHandler;
 import org.apache.uima.ducc.ps.service.errors.ServiceInitializationException;
-import org.apache.uima.ducc.ps.service.errors.IServiceErrorHandler.Action;
-import org.apache.uima.ducc.ps.service.errors.builtin.WindowBasedErrorHandler;
 import org.apache.uima.ducc.ps.service.processor.IServiceProcessor;
 import org.apache.uima.ducc.ps.service.processor.uima.UimaServiceProcessor;
 import org.junit.Test;
@@ -48,12 +45,12 @@ public class JunitPullServiceTestCase ex
                super.startJetty(false);  // don't block
                String analysisEngineDescriptor = "TestAAE";
                System.setProperty("ducc.deploy.JpType", "uima");
-               
-               IServiceProcessor processor = new 
+
+               IServiceProcessor processor = new
                                UimaServiceProcessor(analysisEngineDescriptor);
-               
+
                String tasURL = "http://localhost:"+super.getPort()+"/test";
-               
+
                IService service = 
PullServiceStepBuilder.newBuilder().withProcessor(processor)
                                .withClientURL(tasURL).withType("Note 
Service").withScaleout(scaleout)
                                .withOptionalsDone().build();
@@ -63,7 +60,7 @@ public class JunitPullServiceTestCase ex
                        Timer fTimer = new Timer("testPullService Timer");
                        // after 5secs stop the pull service
                        fTimer.schedule(new MyTimerTask(service, fTimer, 
false), DELAY);
-                       
+
                        service.start();
 
                } catch (ServiceInitializationException e) {
@@ -81,11 +78,11 @@ public class JunitPullServiceTestCase ex
                super.startJetty(false);  // don't block
                String analysisEngineDescriptor = "TestAAE";
                System.setProperty("ducc.deploy.JpType", "uima");
-               IServiceProcessor processor = new 
+               IServiceProcessor processor = new
                                UimaServiceProcessor(analysisEngineDescriptor);
 
                String tasURL = "http://localhost:"+super.getPort()+"/test";
-               
+
                IService service = 
PullServiceStepBuilder.newBuilder().withProcessor(processor)
                                .withClientURL(tasURL).withType("Note 
Service").withScaleout(scaleout)
                                .withOptionalsDone().build();
@@ -95,7 +92,7 @@ public class JunitPullServiceTestCase ex
                        Timer fTimer = new Timer("testPullService Timer");
                        // after 5secs stop the pull service
                        fTimer.schedule(new MyTimerTask(service, fTimer, true), 
DELAY);
-                       
+
                        service.start();
 
                } catch (ServiceInitializationException e) {
@@ -113,11 +110,11 @@ public class JunitPullServiceTestCase ex
                super.startJetty(true);  // true=client blocks all POST requests
                int scaleout = 12;
                String analysisEngineDescriptor = "TestAAE";
-               IServiceProcessor processor = new 
+               IServiceProcessor processor = new
                                UimaServiceProcessor(analysisEngineDescriptor);
 
                String tasURL ="http://localhost:"+super.getPort()+"/test";
-               
+
                IService service = 
PullServiceStepBuilder.newBuilder().withProcessor(processor)
                                .withClientURL(tasURL).withType("Note 
Service").withScaleout(scaleout)
                                .withOptionalsDone().build();
@@ -131,7 +128,7 @@ public class JunitPullServiceTestCase ex
 
                        service.start();
 
-                       
+
                } catch (ServiceInitializationException e) {
                        throw e;
                } catch (Exception e) {
@@ -140,7 +137,7 @@ public class JunitPullServiceTestCase ex
                        super.stopJetty();
                }
        }
-       
+
        @Test
        public void testStopOnFirstError() throws Exception {
                System.out.println("----------------- testStopOnFirstError 
-------------------");
@@ -148,14 +145,14 @@ public class JunitPullServiceTestCase ex
                super.startJetty(false);  // don't block
                String analysisEngineDescriptor = "NoOpAE";
                System.setProperty("ducc.deploy.JpType", "uima");
-               
+
                IServiceProcessor processor =
                                new 
UimaServiceProcessor(analysisEngineDescriptor);
                // fail on 1st error
                processor.setErrorHandlerWindow(1,  5);
 
                String tasURL = "http://localhost:"+super.getPort()+"/test";
-               
+
                IService service = 
PullServiceStepBuilder.newBuilder().withProcessor(processor)
                                .withClientURL(tasURL).withType("Note 
Service").withScaleout(scaleout)
                                .withOptionalsDone().build();
@@ -163,7 +160,7 @@ public class JunitPullServiceTestCase ex
                try {
                        System.setProperty("ProcessFail","2");
                        service.initialize();
-                       
+
                        service.start();
 
                } catch (ServiceInitializationException e) {
@@ -182,13 +179,13 @@ public class JunitPullServiceTestCase ex
                super.startJetty(false);  // don't block
                String analysisEngineDescriptor = "NoOpAE";
                System.setProperty("ducc.deploy.JpType", "uima");
-               
+
                IServiceProcessor processor =
                                new 
UimaServiceProcessor(analysisEngineDescriptor);
                // fail on 2nd error in a window of 5
                processor.setErrorHandlerWindow(2,  5);
                String tasURL = "http://localhost:"+super.getPort()+"/test";
-               
+
                IService service = 
PullServiceStepBuilder.newBuilder().withProcessor(processor)
                                .withClientURL(tasURL).withType("Note 
Service").withScaleout(scaleout)
                                .withOptionalsDone().build();
@@ -197,7 +194,7 @@ public class JunitPullServiceTestCase ex
                        // fail task#1 and task#3 which should stop the test
                        System.setProperty("ProcessFail","1,3");
                        service.initialize();
-                       
+
                        service.start();
 
                } catch (ServiceInitializationException e) {
@@ -215,11 +212,11 @@ public class JunitPullServiceTestCase ex
                int scaleout = 2;
                super.startJetty(false);  // don't block
                String analysisEngineDescriptor = "NoOpAE";
-               IServiceProcessor processor = new 
+               IServiceProcessor processor = new
                                UimaServiceProcessor(analysisEngineDescriptor);
 
                String tasURL = "http://localhost:"+super.getPort()+"/test";
-               
+
                IService service = 
PullServiceStepBuilder.newBuilder().withProcessor(processor)
                                .withClientURL(tasURL).withType("Note 
Service").withScaleout(scaleout)
                                .withOptionalsDone().build();
@@ -231,7 +228,7 @@ public class JunitPullServiceTestCase ex
                        Timer fTimer = new Timer("testPullService Timer");
                        // after 5secs stop the pull service
                        fTimer.schedule(new MyTimerTask(service, fTimer, 
false), DELAY);
-                       
+
                        service.start();
 
                } catch (ServiceInitializationException e) {
@@ -250,11 +247,11 @@ public class JunitPullServiceTestCase ex
                int scaleout = 2;
                super.startJetty(false);  // don't block
                String analysisEngineDescriptor = "TestAAE";
-               IServiceProcessor processor = new 
+               IServiceProcessor processor = new
                                UimaServiceProcessor(analysisEngineDescriptor);
 
                String tasURL ="http://localhost2:8080/test";;
-               
+
                IService service = 
PullServiceStepBuilder.newBuilder().withProcessor(processor)
                                .withClientURL(tasURL).withType("Note 
Service").withScaleout(scaleout)
                                .withOptionalsDone().build();
@@ -263,7 +260,7 @@ public class JunitPullServiceTestCase ex
                        service.initialize();
                        service.start();
 
-                       
+
                } catch (ServiceInitializationException e) {
                        throw e;
                } catch (Exception e) {
@@ -275,7 +272,7 @@ public class JunitPullServiceTestCase ex
                final IService service;
                final Timer fTimer;
                final boolean quiesce;
-               
+
                MyTimerTask(IService service, Timer fTimer, boolean quiesce) {
                        this.service = service;
                        this.fTimer = fTimer;

Modified: 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/test/ae/NoOpAE.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/test/ae/NoOpAE.java?rev=1851641&r1=1851640&r2=1851641&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/test/ae/NoOpAE.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-pullservice/src/test/java/org/apache/uima/ducc/ps/test/ae/NoOpAE.java
 Fri Jan 18 20:08:20 2019
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,7 +24,6 @@ import java.lang.management.ManagementFa
 import java.lang.management.RuntimeMXBean;
 import java.util.Map;
 import java.util.Objects;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.uima.UIMAFramework;
@@ -37,7 +36,7 @@ import org.apache.uima.util.Level;
 import org.apache.uima.util.Logger;
 
 
-public class NoOpAE extends CasAnnotator_ImplBase 
+public class NoOpAE extends CasAnnotator_ImplBase
 {
     Logger logger;
     static boolean initComplete = false;
@@ -46,7 +45,7 @@ public class NoOpAE extends CasAnnotator
        String errorSequence;
 
     @Override
-    public void initialize(UimaContext uimaContext) throws 
ResourceInitializationException 
+    public void initialize(UimaContext uimaContext) throws 
ResourceInitializationException
     {
        processCount.set(0);
         super.initialize(uimaContext);
@@ -60,7 +59,7 @@ public class NoOpAE extends CasAnnotator
         Map<String, String> env = System.getenv();
         RuntimeMXBean rmxb = ManagementFactory.getRuntimeMXBean();
         String pid = rmxb.getName();
- 
+
         logger = UIMAFramework.getLogger(NoOpAE.class);
         if ( logger == null ) {
             System.out.println("Is this nuts or what, no logger!");
@@ -84,7 +83,7 @@ public class NoOpAE extends CasAnnotator
         return;
     }
 
- 
+
     void dolog(Object ... args)
     {
         StringBuffer sb = new StringBuffer();
@@ -101,7 +100,7 @@ public class NoOpAE extends CasAnnotator
     public void destroy()
     {
         System.out.println(AE_Identifier + " Destroy is called (0)");
-        dolog("Destroy is called (1) !");        
+        dolog("Destroy is called (1) !");
         try {
             Thread.sleep(3000);                         // simulate actual 
work being done here
         } catch (InterruptedException e) {
@@ -110,7 +109,7 @@ public class NoOpAE extends CasAnnotator
     }
 
     @Override
-    public void process(CAS cas) throws AnalysisEngineProcessException 
+    public void process(CAS cas) throws AnalysisEngineProcessException
     {
        long val = processCount.incrementAndGet();
        //String data = cas.getSofaDataString();
@@ -123,11 +122,11 @@ public class NoOpAE extends CasAnnotator
                                                System.out.println(">>>> Error: 
errorSeq:"+errorSeq+" processCount:"+val);
                                        throw new 
AnalysisEngineProcessException(new RuntimeException("Simulated Exception"));
                                        }
-                                       
+
                                }
                }
                }
     }
 
- 
+
 }


Reply via email to