Package java.util.concurrent

Examples of java.util.concurrent.ThreadPoolExecutor.submit()


    // Now let's simulate adding a RS meaning that we'll go up to three
    // concurrent threads. The pool should not grow larger than three.
    pool.submit(threads.get(2));
    pool.submit(threads.get(3));
    pool.submit(threads.get(4));
    assertEquals(3, pool.getPoolSize());
    queue.put(new Object());
    queue.put(new Object());
    queue.put(new Object());
  }
View Full Code Here


     // Split each store file.
    for (StoreFile sf: hstoreFilesToSplit) {
      //splitStoreFile(sf, splitdir);
      StoreFileSplitter sfs = new StoreFileSplitter(sf, splitdir);
      futures.add(threadPool.submit(sfs));
    }
    // Shutdown the pool
    threadPool.shutdown();

    // Wait for all the tasks to finish
View Full Code Here

        ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());

        try
        {
            Future<Boolean> result = pool.submit(new Callable<Boolean>()
            {
                public Boolean call() throws Exception
                {
                    futureFrameworkEvent.get();
View Full Code Here

        ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());

        try
        {
            Future<Boolean> result = pool.submit(new Callable<Boolean>()
            {
                public Boolean call() throws Exception
                {
                    futureFrameworkEvent.get(60, TimeUnit.SECONDS);
View Full Code Here

        ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());

        try
        {
            Future<Boolean> result = pool.submit(new Callable<Boolean>()
            {
                public Boolean call() throws Exception
                {
                    futureFrameworkEvent.get(1, TimeUnit.SECONDS);
View Full Code Here

        ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());

        try
        {
            Future<FrameworkEvent> result = pool.submit(new Callable<FrameworkEvent>()
            {
                public FrameworkEvent call() throws Exception
                {
                    return framework.waitForStop(0);
                }
View Full Code Here

                        throws Exception
                    {
                        return fork( testSet, properties, forkClient, fileReporterFactory.getGlobalRunStatistics() );
                    }
                };
                results.add( executorService.submit( pf ) );

            }

            for ( Future<RunResult> result : results )
            {
View Full Code Here

    // Split each store file.
    for (Map.Entry<byte[], List<StoreFile>> entry: hstoreFilesToSplit.entrySet()) {
      for (StoreFile sf: entry.getValue()) {
        StoreFileSplitter sfs = new StoreFileSplitter(entry.getKey(), sf);
        futures.add(threadPool.submit(sfs));
      }
    }
    // Shutdown the pool
    threadPool.shutdown();
View Full Code Here

                                                                startupReportConfiguration.getTestVmSystemProperties() );
                        return fork( testSet, new PropertiesWrapper( providerConfiguration.getProviderProperties() ),
                                     forkClient, effectiveSystemProperties, thisThreadsThreadNumber, null );
                    }
                };
                results.add( executorService.submit( pf ) );

            }

            for ( Future<RunResult> result : results )
            {
View Full Code Here

                                     forkClient, effectiveSystemProperties, finalThreadNumber,
                                     testProvidingInputStream );
                    }
                };

                results.add( executorService.submit( pf ) );
            }

            for ( Future<RunResult> result : results )
            {
                try
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.