org.apache.solr.handler.component

## Class TrackingShardHandlerFactory.RequestTrackingQueue

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.AbstractSequentialList<E>
      - - java.util.LinkedList<TrackingShardHandlerFactory.ShardRequestAndParams>
        - - org.apache.solr.handler.component.TrackingShardHandlerFactory.RequestTrackingQueue

- All Implemented Interfaces:
    Serializable, Cloneable, Iterable<TrackingShardHandlerFactory.ShardRequestAndParams>, Collection<TrackingShardHandlerFactory.ShardRequestAndParams>, Deque<TrackingShardHandlerFactory.ShardRequestAndParams>, List<TrackingShardHandlerFactory.ShardRequestAndParams>, Queue<TrackingShardHandlerFactory.ShardRequestAndParams>
  Enclosing class:
    TrackingShardHandlerFactory

      public static class TrackingShardHandlerFactory.RequestTrackingQueue
      extends LinkedList<TrackingShardHandlerFactory.ShardRequestAndParams>

  A queue having helper methods to select requests by shard and purpose.
  See Also:
    `TrackingShardHandlerFactory.setTrackingQueue(java.util.List, java.util.Queue)`, Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequestTrackingQueue()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `Map<String,List<TrackingShardHandlerFactory.ShardRequestAndParams>>` | `getAllRequests()` Retrieves all requests recorded by this collection as a Map of shard address (string url) to a list of `TrackingShardHandlerFactory.ShardRequestAndParams`
    `List<TrackingShardHandlerFactory.ShardRequestAndParams>` | `getCoreAdminRequests()` Retrieves all core admin requests distributed to nodes by Collection API commands
    `TrackingShardHandlerFactory.ShardRequestAndParams` | `getShardRequestByPurpose(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collectionName, String shardId, int purpose)` Retrieve request recorded by this queue which were sent to given collection, shard and purpose
    `List<TrackingShardHandlerFactory.ShardRequestAndParams>` | `getShardRequests(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collectionName, String shardId)` Retrieve all requests recorded by this queue which were sent to given collection and shard
    `boolean` | `offer(TrackingShardHandlerFactory.ShardRequestAndParams shardRequestAndParams)`

    - ### Methods inherited from class java.util.LinkedList

      `add, add, addAll, addAll, addFirst, addLast, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray`

    - ### Methods inherited from class java.util.AbstractSequentialList

      `iterator`

    - ### Methods inherited from class java.util.AbstractList

      `equals, hashCode, listIterator, removeRange, subList`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll, isEmpty, removeAll, retainAll, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.List

      `containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList`

    - ### Methods inherited from interface java.util.Deque

      `iterator`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, removeIf, stream`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Constructor Detail

    - #### RequestTrackingQueue

          public RequestTrackingQueue()

  - ### Method Detail

    - #### offer

          public boolean offer(TrackingShardHandlerFactory.ShardRequestAndParams shardRequestAndParams)

      Specified by:
        `offer` in interface `Deque<TrackingShardHandlerFactory.ShardRequestAndParams>`
      Specified by:
        `offer` in interface `Queue<TrackingShardHandlerFactory.ShardRequestAndParams>`
      Overrides:
        `offer` in class `LinkedList<TrackingShardHandlerFactory.ShardRequestAndParams>`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `Collection<TrackingShardHandlerFactory.ShardRequestAndParams>`
      Specified by:
        `clear` in interface `List<TrackingShardHandlerFactory.ShardRequestAndParams>`
      Overrides:
        `clear` in class `LinkedList<TrackingShardHandlerFactory.ShardRequestAndParams>`

    - #### getShardRequestByPurpose

          public TrackingShardHandlerFactory.ShardRequestAndParams getShardRequestByPurpose(org.apache.solr.common.cloud.ZkStateReader zkStateReader,
                                                                                            String collectionName,
                                                                                            String shardId,
                                                                                            int purpose)
                                                                                     throws RuntimeException

      Retrieve request recorded by this queue which were sent to given collection, shard and purpose
      Parameters:
        `zkStateReader` - the `ZkStateReader` from which cluster state is read
        `collectionName` - the given collection name for which requests have to be extracted
        `shardId` - the given shard name for which requests have to be extracted
        `purpose` - the shard purpose
      Returns:
        instance of `TrackingShardHandlerFactory.ShardRequestAndParams` or null if none is found
      Throws:
        `RuntimeException` - if more than one request is found to the same shard with the same purpose

    - #### getShardRequests

          public List<TrackingShardHandlerFactory.ShardRequestAndParams> getShardRequests(org.apache.solr.common.cloud.ZkStateReader zkStateReader,
                                                                                          String collectionName,
                                                                                          String shardId)

      Retrieve all requests recorded by this queue which were sent to given collection and shard
      Parameters:
        `zkStateReader` - the `ZkStateReader` from which cluster state is read
        `collectionName` - the given collection name for which requests have to be extracted
        `shardId` - the given shard name for which requests have to be extracted
      Returns:
        a list of `TrackingShardHandlerFactory.ShardRequestAndParams` or empty list if none are found

    - #### getCoreAdminRequests

          public List<TrackingShardHandlerFactory.ShardRequestAndParams> getCoreAdminRequests()

      Retrieves all core admin requests distributed to nodes by Collection API commands
      Returns:
        a list of `TrackingShardHandlerFactory.ShardRequestAndParams` or empty if none found

    - #### getAllRequests

          public Map<String,List<TrackingShardHandlerFactory.ShardRequestAndParams>> getAllRequests()

      Retrieves all requests recorded by this collection as a Map of shard address (string url) to a list of `TrackingShardHandlerFactory.ShardRequestAndParams`
      Returns:
        a `ConcurrentHashMap` of url strings to `TrackingShardHandlerFactory.ShardRequestAndParams` objects or empty map if none have been recorded

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.