Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicInteger.incrementAndGet()


            {
               JournalImpl.this.compact();
            }
            catch (Throwable e)
            {
               errors.incrementAndGet();
               JournalImpl.log.error(e.getMessage(), e);
               e.printStackTrace();
            }
            finally
            {
View Full Code Here


                    getIncomingMeter(stream.getId()).mark();
                    matches.add(stream);
                }
            } catch (Exception e) {
                AtomicInteger faultCount = getFaultCount(stream.getId());
                int streamFaultCount = faultCount.incrementAndGet();
                getStreamRuleTimeoutMeter(stream.getId()).mark();
                if (maxFaultCount > 0 && streamFaultCount >= maxFaultCount) {
                    try {
                        streamService.pause(stream);
                        faultCount.set(0);
View Full Code Here

    public void testScheduleCancelsPendingTasksOk() throws Exception {
        final AtomicInteger m_counter = new AtomicInteger(0);

        Runnable task = new Runnable() {
            public void run() {
                m_counter.incrementAndGet();
            }
        };
       
        m_timer = new ResettableTimer(task, 100, TimeUnit.MILLISECONDS);
        m_timer.schedule();
View Full Code Here

    public void testScheduleMultipleTasksOk() throws Exception {
        final AtomicInteger m_counter = new AtomicInteger(0);

        Runnable task = new Runnable() {
            public void run() {
                m_counter.incrementAndGet();
            }
        };

        m_timer = new ResettableTimer(task, 100, TimeUnit.MILLISECONDS);
       
View Full Code Here

    public void testShutDownOk() throws Exception {
        final AtomicInteger m_counter = new AtomicInteger(0);

        Runnable task = new Runnable() {
            public void run() {
                m_counter.incrementAndGet();
            }
        };
       
        m_timer = new ResettableTimer(task, 100, TimeUnit.MILLISECONDS);
        m_timer.schedule();
View Full Code Here

            {
                public void repositoryChanged(RepositoryChangeEvent event)
                {
                    if (!SigilUI.WORKSPACE_REPOSITORY_ID.equals(event.getRepository().getId()))
                    {
                        final int update = updateCounter.incrementAndGet();

                        Job job = new Job("Pending repository update")
                        {
                            @Override
                            protected IStatus run(IProgressMonitor monitor)
View Full Code Here

                    reader.next(key, value);
                    store.put(new ByteArray(ByteUtils.copy(key.get(), 0, key.getSize())),
                              Versioned.value(ByteUtils.copy(value.get(), 0, value.getSize())), null);
                } catch(ObsoleteVersionException e) {
                    obsoletes.incrementAndGet();
                }
            }
        };
        readWriteTest.run(30 * 1000 * 1000, 1);
        System.out.println("Bdb write throuhput with one thread:");
View Full Code Here

                    reader.next(key, value);
                    store.put(new ByteArray(ByteUtils.copy(key.get(), 0, key.getSize())),
                              Versioned.value(ByteUtils.copy(value.get(), 0, value.getSize())), null);
                } catch(ObsoleteVersionException e) {
                    obsoletes.incrementAndGet();
                }
            }
        };
        readWriteTest.run(1000, 1);
        System.out.println("MySQl write throuhput with one thread:");
View Full Code Here

            public void run() {
                while(keepRunning.get()) {
                    byte[] bytes = Integer.toString(count.getAndIncrement()).getBytes();
                    store.put(new ByteArray(bytes), Versioned.value(bytes), null);
                    count.incrementAndGet();
                }
            }
        });
        executor.execute(new Runnable() {
View Full Code Here

            public void run() {
                while(keepRunning.get()) {
                    byte[] bytes = Integer.toString(rand.nextInt(count.get())).getBytes();
                    store.delete(new ByteArray(bytes), new VectorClock());
                    count.incrementAndGet();
                }
            }
        });

        // wait a bit
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.