org.apache.solr.client.solrj.cloud.autoscaling

## Class Suggester

- java.lang.Object
- - org.apache.solr.client.solrj.cloud.autoscaling.Suggester

All Implemented Interfaces:
  MapSerializable, MapWriter

Direct Known Subclasses:
  MoveReplicaSuggester, NoneSuggester, UnsupportedSuggester

    public abstract class Suggester
    extends Object
    implements MapWriter

### Nested Class Summary

Nested Classes
`static class` `Suggester.Hint`
`static class` `Suggester.SuggestionInfo`

### Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

### Field Summary

Fields
`protected EnumMap<Suggester.Hint,Object>` `hints`
`protected List<Violation>` `originalViolations`

### Constructor Summary

Constructors
Constructor and Description
`Suggester()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected String` `findWithCollection(Set<String> collections, Set<Pair<String,String>> s)`
`Suggester` `forceOperation(boolean force)` Normally, only less loaded nodes are used for moving replicas.
`CollectionParams.CollectionAction` `getAction()`
`Policy.Session` `getSession()`
`SolrRequest` `getSuggestion()`
`protected Optional<String>` `getWithCollection(String collectionName)`
`Suggester` `hint(Suggester.Hint hint, Object value)`
`protected boolean` `isAllowed(Object v, Suggester.Hint hint)`
`protected boolean` `isNodeSuitableForReplicaAddition(Row row)`
`protected Collection` `setupWithCollectionTargetNodes(Set<String> collections, Set<Pair<String,String>> s, String withCollection)`
`String` `toString()`
`void` `writeMap(MapWriter.EntryWriter ew)`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.solr.common.MapWriter

`jsonStr, toMap`

### Field Detail

#### hints

    protected final EnumMap<Suggester.Hint,Object> hints

#### originalViolations

    protected List<Violation> originalViolations

### Constructor Detail

#### Suggester

    public Suggester()

### Method Detail

#### hint

    public Suggester hint(Suggester.Hint hint,
                          Object value)

#### getAction

    public CollectionParams.CollectionAction getAction()

#### forceOperation

    public Suggester forceOperation(boolean force)

Normally, only less loaded nodes are used for moving replicas. If this is a violation and a MOVE must be performed, set the flag to true.

#### isNodeSuitableForReplicaAddition

    protected boolean isNodeSuitableForReplicaAddition(Row row)

#### getSuggestion

    public SolrRequest getSuggestion()

#### getWithCollection

    protected Optional<String> getWithCollection(String collectionName)
                                          throws IOException

Throws:
  `IOException`

#### getSession

    public Policy.Session getSession()

#### isAllowed

    protected boolean isAllowed(Object v,
                                Suggester.Hint hint)

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### writeMap

    public void writeMap(MapWriter.EntryWriter ew)
                  throws IOException

Specified by:
  `writeMap` in interface `MapWriter`
Throws:
  `IOException`

#### setupWithCollectionTargetNodes

    protected Collection setupWithCollectionTargetNodes(Set<String> collections,
                                                        Set<Pair<String,String>> s,
                                                        String withCollection)

#### findWithCollection

    protected String findWithCollection(Set<String> collections,
                                        Set<Pair<String,String>> s)