Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicIntegerArray


        /*
         * Reassign rather than clear the histogram, to prevent NPE when
         * concurrent set() and calculate calls are made.
         */
        histogram = new AtomicIntegerArray(maxTrackedLatencyMillis);
        numOps = new AtomicInteger();
        opsOverflow = new AtomicInteger();
        totalNanos = 0;
        max = 0;
        min = Long.MAX_VALUE;
View Full Code Here


    public TestCallbackHandler1(int expectedSuccess, int expectedFailure) {
      this.expectedSuccess = expectedSuccess;
      this.expectedFailure = expectedFailure;

      actualStartSuccessArray = new AtomicIntegerArray(expectedSuccess);
      actualStartFailureArray = new AtomicIntegerArray(expectedFailure);
      actualQuerySuccessArray = new AtomicIntegerArray(expectedSuccess);
      actualQueryFailureArray = new AtomicIntegerArray(expectedFailure);
      actualStopSuccessArray = new AtomicIntegerArray(expectedSuccess);
      actualStopFailureArray = new AtomicIntegerArray(expectedFailure);
    }
View Full Code Here

     * @param size int maximum size of the pool
     */
    public JDBCPool(int size) {
        source = new JDBCPooledDataSource();
        connections = new JDBCPooledConnection[size];
        states = new AtomicIntegerArray(size);    }
View Full Code Here

    Preconditions.checkNotNull(receiver);
    Preconditions.checkNotNull(parentAccounter);

    this.parentAccounter = parentAccounter;
    this.incoming = receiver.getProvidingEndpoints();
    this.remainders = new AtomicIntegerArray(incoming.size());
    this.oppositeMajorFragmentId = receiver.getOppositeMajorFragmentId();
    this.buffers = new RawBatchBuffer[minInputsRequired];
    for(int i = 0; i < buffers.length; i++){
      buffers[i] = new UnlimitedRawBatchBuffer();
    }
View Full Code Here

            }
            setEntries(i, null);
          }
        }
       
        hashtable = new AtomicIntegerArray(1024);
        capacity = hashtable.length() >> 1;
        size.set(0);
      }
      finally {
        tableLock.writeLock().unlock();
View Full Code Here

            delta = 1024;
          }
         
          tableLock.writeLock().lock();
          try {
            AtomicIntegerArray newTable = new AtomicIntegerArray(hashtable.length() + delta);
            for(int i = 0; i != hashtable.length(); ++i) {
              newTable.set(i, hashtable.get(i));
            }
            hashtable = newTable;
            locktable = createLocktable(hashtable.length());
          }
          finally {
View Full Code Here

          int hash = BinHash.hash(key);
          return splitHash(hash, capacity);
      }
   
    public AtomicIntegerArray createLocktable(int size) {
      AtomicIntegerArray table = new AtomicIntegerArray(size / 4); // 8 bits per lock
      return table;
    }
View Full Code Here

   
    this.memUsed.set(0);
    this.pagesInUse.set(0);
   
    this.pages = new AtomicReferenceArray<ByteChunk>(pageUsageLimit);
    this.pageUtilizations = new AtomicIntegerArray(pageUsageLimit);
    this.pageTimestamps = new long[pageUsageLimit];
    this.pagesForCleanUp = new boolean[pageUsageLimit];
   
//    evacuationQueueLimit = pageUsageLimit / 16;
//    evacuationQueueLimit = evacuationQueueLimit < 2 ? 2 : evacuationQueueLimit;
View Full Code Here

        }

        mean  = numKeys / 2;
        sigma = numKeys * STDev;

        operationCount = new AtomicIntegerArray(threads);
        keyCount = new AtomicIntegerArray(threads);
        latencies = new AtomicLongArray(threads);
    }
View Full Code Here

                out.writeNull();
            }
            return;
        }

        AtomicIntegerArray array = (AtomicIntegerArray) object;
        int len = array.length();
        out.append('[');
        for (int i = 0; i < len; ++i) {
            int val = array.get(i);
            if (i != 0) {
                out.write(',');
            }
            out.writeInt(val);
        }
View Full Code Here

TOP

Related Classes of java.util.concurrent.atomic.AtomicIntegerArray

Copyright © 2018 www.massapicom. 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.