Package java.util.concurrent

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


      final Put put = new Put(++transactionID, WriteOrderOracle.next(),
          eventIn);
      ByteBuffer bytes = TransactionEventRecord.toByteBuffer(put);
      FlumeEventPointer ptr = logFileWriter.put(bytes);
      final int offset = ptr.getOffset();
      executorService.submit(new Runnable() {
        @Override
        public void run() {
          try {
            FlumeEvent eventOut = logFileReader.get(offset);
            Assert.assertEquals(eventIn.getHeaders(), eventOut.getHeaders());
View Full Code Here


        {
            List<Future<Object>> brokers = new CopyOnWriteArrayList<Future<Object>>();
            for (final Integer brokerPortNumber : _brokerConfigurations.keySet())
            {
                final BrokerConfigHolder brokerConfigHolder = _brokerConfigurations.get(brokerPortNumber);
                Future<Object> future = executor.submit(new Callable<Object>()
                {
                    public Object call()
                    {
                        try
                        {
View Full Code Here

    admin.createTable(desc);
    HTable table = new HTable(conf, desc.getName());

    ExecutorService service = Executors.newCachedThreadPool();
    for (int i = 0; i < 5; i++) {
      service.submit(new Writer(table, family, qualifier, sequence, rows));
    }

    byte[] value = Bytes.toBytes((FIXED_PART + 0).toCharArray());
    IdxScan idxScan = new IdxScan();
    idxScan.setExpression(Expression.comparison(family, qualifier,
View Full Code Here

                if (isServiced(cn.getName()) || deploymentExists(cn.getName()))
                    continue;

                results.add(
                        es.submit(new DeployDescriptor(this, cn, contextXml)));
            }
        }

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

                            "hostConfig.illegalWarName", files[i]));
                    invalidWars.add(files[i]);
                    continue;
                }

                results.add(es.submit(new DeployWar(this, cn, war)));
            }
        }

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

                ContextName cn = new ContextName(files[i]);

                if (isServiced(cn.getName()) || deploymentExists(cn.getName()))
                    continue;

                results.add(es.submit(new DeployDirectory(this, cn, dir)));
            }
        }

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

    // Executor thread is shutdown inside as thread gets killed when you
    // shutdown
    ExecutorService threadExecutor = Executors.newSingleThreadExecutor();
    DoWhileHandler doWhileHandler = new DoWhileHandler((DoWhileNode) node, this.invokerMap, getWaitingNodesDynamically(),
        getFinishedNodesDynamically(), this, threadExecutor);
    threadExecutor.submit(doWhileHandler);
  }

  private void handleSubWorkComponent(Node node) throws WorkflowException {
    notifyViaInteractor(WorkflowExecutionMessage.OPEN_SUBWORKFLOW, node);
    // setting the inputs
View Full Code Here

    final Object waitLock = new Object();
    ExecutorService executorService = Executors.newFixedThreadPool(numVersions);
    final AtomicReference<AssertionError> error = new AtomicReference<AssertionError>(null);
    for (int versions = numVersions; versions < numVersions * 2; versions++) {
      final int versionsCopy = versions;
      executorService.submit(new Callable<Void>() {
        @Override
        public Void call() {
          try {
            Put put = new Put(ROW);
            put.add(FAMILY, QUALIFIER, ts + versionsCopy, VALUE);
View Full Code Here

        final TargetServer target = new TargetServer(config);

        // Getting an Executor
        ExecutorService threadPool = Executors.newSingleThreadExecutor();
        // Starting the target
        threadPool.submit(target);

    }

}
View Full Code Here

        final int numberOfThreads = 40;
        final ExecutorService executor = Executors.newFixedThreadPool(numberOfThreads / 2);
        for (int i = 0; i < numberOfThreads; i++) {
            final Locale language = i < numberOfThreads / 2 ? Locale.ENGLISH : Locale.GERMAN;
            executor.submit(new Runnable() {
                @Override
                public void run() {
                    provider.getResourceBundle(language);
                }
            });
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.