Add new names to the IndexQueue.
@return The number of items added to the queue.
@throws IOException
540880
public int updateQueue() throws IOException {
		int added = 0;
		long lastMarkPoint = lastMark.getLastMark();
		long currentMarkPoint = db.getCurrentMark();
		if(currentMarkPoint > lastMarkPoint) {
			// TODO: touchy touchy... need transactions here to not have 
			// state sync problems if something goes badly in this block..
			// for example, it would be possible to constantly enqueue the
			// same files forever..
			CloseableIterator<String> newNames = 
				db.getNamesBetweenMarks(lastMarkPoint, currentMarkPoint);
			while(newNames.hasNext()) {
				String newName = newNames.next();
				LOGGER.info("Queued " + newName + " for indexing.");
				queue.enqueue(newName);
				added++;
			}
			newNames.close();
			lastMark.setLastMark(currentMarkPoint);
		}
		return added;
	}
183191
public String getNextIndex() {
        String newIndex;

        do {
            newIndex = "tsx" + String.valueOf(lastIndexIndex);
            lastIndexIndex++;
        }
        while (exists(newIndex) == true);

        addIndex(newIndex);

        return newIndex;
    }
623803
public void add(int num, int[] indices) {
        for (int i = 0; i < indices.length; ++i)
            indices[i] += num;
    }
1133119
@Override
    public List values() throws IOException {
	List<String> keys = keys();
	List<Object> list = new ArrayList<Object>();
	Iterator<String> it = keys.iterator();
	String key;
	while (it.hasNext()) {
	    key = it.next();
	    list.add(getQuiet(key, null).getValue());
	}
	return list;
    }
1284157
public boolean add(Object o) {
        synchronized (pool) {
            if (index < pool.length) {
                pool[index++] = o;
                // if (DEBUG && tc.isDebugEnabled() )
                // Tr.debug(tc,"added to pool " + name + " at " + index);
                return true;
            }
        }
        // if (DEBUG && tc.isDebugEnabled() )
        // Tr.debug(tc,"pool " + name + " is full");
        return false;
    }
59692
protected void setupQueue() throws IOException {
		if (queueName != null) {
			channel.queueDeclare(queueName, false, false, false, null);
		}
	}
1213457
public Collection<INDArray> getUpdates() {
        // just drain stuff from the queue
        val list = new ArrayList<INDArray>();
        updatesQueue.drainTo(list);
        return list;
    }
524428
private static int index(Object o) {
        Integer i = TYPE_INDICES.get(o);
        if (i == null) {
            synchronized (TYPE_INDICES) {
                // check that another thread did not already update the index
                i = TYPE_INDICES.get(o);
                if (i != null)
                    return i;
                else {
                    int j = TYPE_INDICES.size();
                    TYPE_INDICES.put(o, j);
                    TYPES.add(o);
                    return j;
                }
            }
        }
        return i;
    }
803740
public synchronized int add(E object) {
		if (object == null)
			throw new NullPointerException("FastList add called with null");

		if ((count + 1) >= maxCount)
			resize(capacity * 2);

		int initialAddIndex = addIndex;

		// find right spot to add to - start with addIndex and look
		// for first open spot. give up if we get back to initialAddIndex
		while (listElements[addIndex] != null) {
			addIndex++;
			if (addIndex == capacity)
				addIndex = 0;

			if (addIndex == initialAddIndex) {
				// should not happen - we should have resized if we needed more
				// capacity
				throw new RuntimeException("FastList out of space");
			}
		}

		count++;
		listElements[addIndex] = object;

		return addIndex;
	}
1192017
private void displayQueueList() throws IOException {
    JobQueueInfo[] queues = jc.getQueues();
    for (JobQueueInfo queue : queues) {
      String schedInfo = queue.getSchedulingInfo();
      if(schedInfo.trim().equals("")){
        schedInfo = "N/A";
      }
      System.out.printf("Queue Name : %s \n", queue.getQueueName());
      System.out.printf("Scheduling Info : %s \n",queue.getSchedulingInfo());
    }
  }
1220206
public static <E, T extends E> void add(List<E> list, int index, T item){
        if(index<list.size())
            list.add(index, item);
        else
            list.add(item);
    }
82937
@Override
    public void add(int index, E element) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            Object[] elements = getArray();
            int len = elements.length;
            if (index > len || index < 0)
                throw new IndexOutOfBoundsException("Index: " + index +
                                                    ", Size: " + len);
            Object[] newElements;
            int numMoved = len - index;
            if (numMoved == 0)
                newElements = Arrays.copyOf(elements, len + 1);
            else {
                newElements = new Object[len + 1];
                System.arraycopy(elements, 0, newElements, 0, index);
                System.arraycopy(elements, index, newElements, index + 1,
                                 numMoved);
            }
            newElements[index] = element;
            setArray(newElements);
        } finally {
            lock.unlock();
        }
    }
1321110
public synchronized void put(final Object o) {
        final Bucket b = new Bucket(o);

        if (tail != null) {
            tail.setNext(b);
            tail = b;
        } else {
            // queue was empty but has one element now
            head = tail = b;
        }
        count++;

        // notify any waiting tasks
        notify();
    }
270404
protected String createName() {
        final StringBuilder buf = new StringBuilder(128);
        try {
            buf.append(InetAddress.getLocalHost().getHostName()).append(COLON)
                    .append(ManagementFactory.getRuntimeMXBean().getName().split("@")[0]) // PID
                    .append('-').append(this.workerId).append(COLON).append(JAVA_DYNAMIC_QUEUES);
            for (final String queueName : this.queueNames) {
                buf.append(',').append(queueName);
            }
        } catch (UnknownHostException uhe) {
            throw new RuntimeException(uhe);
        }
        return buf.toString();
    }
33195
@Override
    public boolean add(E e) {
        synchronized (linkedList) {
            if (capacity <= linkedList.size())
                linkedList.remove();
            return addAndChangeCurrentIndex(e);
        }
    }
246031
public int addAll(Iterable<? extends KTypeCursor<? extends KType>> iterable) {
    int size = 0;
    for (KTypeCursor<? extends KType> cursor : iterable) {
      add(cursor.value);
      size++;
    }
    return size;
  }
700620
protected void processQueue() {
        try {
            QueueItem item = queue.take();
            client.addMultipleCounterDataPoints(item.tenantId, item.data);
        } catch (InterruptedException e) {
            // TODO better logging of this unlikely error
            e.printStackTrace();
            return;
        }
    }