congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ExecutorAllCompletionService
Code IndexAdd Tabnine to your IDE (free)

How to use
ExecutorAllCompletionService
in
org.infinispan.executors

Best Java code snippets using org.infinispan.executors.ExecutorAllCompletionService (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: org.infinispan/infinispan-embedded-query

@Override
public void process(final KeyFilter filter, final CacheLoaderTask task, Executor executor, boolean fetchValue, boolean fetchMetadata) {
 scanForUnknownDirectories();
 ExecutorAllCompletionService eacs = new ExecutorAllCompletionService(executor);
   eacs.submit(new Callable<Void>() {
    @Override
    public Void call() throws Exception {
 eacs.waitUntilAllCompleted();
 if (eacs.isExceptionThrown()) {
   throw new PersistenceException("Execution exception!", eacs.getFirstException());
origin: org.infinispan/infinispan-core

public void testExceptions() {
 ExecutorAllCompletionService service = createService(1);
 service.submit(new WaitRunnable(1), null);
 service.submit(new ExceptionRunnable("second"), null);
 service.submit(new WaitRunnable(1), null);
 service.submit(new ExceptionRunnable("third"), null);
 service.waitUntilAllCompleted();
 assertTrue(service.isAllCompleted());
 assertTrue(service.isExceptionThrown());
 assertEquals("second", findCause(service.getFirstException()).getMessage());
}
origin: org.infinispan/infinispan-core

private ExecutorAllCompletionService createService(int maxThreads) {
 if (lastExecutorService != null) {
   lastExecutorService.shutdownNow();
 }
 lastExecutorService = Executors.newFixedThreadPool(maxThreads, getTestThreadFactory("Worker"));
 return new ExecutorAllCompletionService(lastExecutorService);
}
origin: org.infinispan/infinispan-cachestore-jpa

eacs.submit(new Runnable() {
  @Override
  public void run() {
origin: org.infinispan/infinispan-lucene-v3

@Override
public void process(final KeyFilter filter, final CacheLoaderTask task, Executor executor, boolean fetchValue, boolean fetchMetadata) {
 scanForUnknownDirectories();
 ExecutorAllCompletionService eacs = new ExecutorAllCompletionService(executor);
   eacs.submit(new Callable<Void>() {
    @Override
    public Void call() throws Exception {
 eacs.waitUntilAllCompleted();
 if (eacs.isExceptionThrown()) {
   throw new PersistenceException("Execution exception!", eacs.getFirstException());
origin: org.infinispan/infinispan-core

public void testWaitForAll() {
 ExecutorAllCompletionService service = createService(1);
 long before = System.currentTimeMillis();
 service.submit(new WaitRunnable(500), null);
 service.submit(new WaitRunnable(500), null);
 service.waitUntilAllCompleted();
 long after = System.currentTimeMillis();
 assertTrue(after - before >= 1000);
 assertTrue(service.isAllCompleted());
 assertFalse(service.isExceptionThrown());
}
origin: org.infinispan/infinispan-cachestore-jpa

  return;
ExecutorAllCompletionService eacs = new ExecutorAllCompletionService(threadPool);
EntityManager emStream = emf.createEntityManager();
try {
  emStream.close();
eacs.waitUntilAllCompleted();
if (eacs.isExceptionThrown()) {
  throw new JpaStoreException(eacs.getFirstException());
origin: org.infinispan/infinispan-core

public void testParallelWait() throws InterruptedException {
 final ExecutorAllCompletionService service = createService(2);
 for (int i = 0; i < 300; ++i) {
   service.submit(new WaitRunnable(10), null);
 }
 List<Thread> threads = new ArrayList<>(10);
 for (int i = 0; i < 10; ++i) {
   Thread t = new Thread(() -> {
    service.waitUntilAllCompleted();
    assertTrue(service.isAllCompleted());
    assertFalse(service.isExceptionThrown());
   });
   threads.add(t);
   t.start();
 }
 for (Thread t : threads) {
   t.join();
 }
 assertTrue(service.isAllCompleted());
 assertFalse(service.isExceptionThrown());
}
origin: org.infinispan/infinispan-core

public void testParallelException() throws InterruptedException {
 final ExecutorAllCompletionService service = createService(2);
 for (int i = 0; i < 150; ++i) {
   service.submit(new WaitRunnable(10), null);
 }
 service.submit(new ExceptionRunnable("foobar"), null);
 for (int i = 0; i < 150; ++i) {
   service.submit(new WaitRunnable(10), null);
 }
 List<Thread> threads = new ArrayList<>(10);
 for (int i = 0; i < 10; ++i) {
   Thread t = new Thread(() -> {
    service.waitUntilAllCompleted();
    assertTrue(service.isAllCompleted());
    assertTrue(service.isExceptionThrown());
   });
   threads.add(t);
   t.start();
 }
 for (Thread t : threads) {
   t.join();
 }
 assertTrue(service.isAllCompleted());
 assertTrue(service.isExceptionThrown());
}
org.infinispan.executorsExecutorAllCompletionService

Most used methods

  • <init>
  • getFirstException
  • isExceptionThrown
  • submit
  • waitUntilAllCompleted
  • isAllCompleted

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • ImageIO (javax.imageio)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now