Class ConfigurableScanServerHostSelector

java.lang.Object
org.apache.accumulo.core.spi.scan.ConfigurableScanServerSelector
org.apache.accumulo.core.spi.scan.ConfigurableScanServerHostSelector
All Implemented Interfaces:
ScanServerSelector

public class ConfigurableScanServerHostSelector extends ConfigurableScanServerSelector
Extension of the ConfigurableScanServerSelector that can be used when there are multiple ScanServers running on the same host and for some reason, like using a shared off-heap cache, sending scans for the same tablet to the same host may provide a better experience.

This implementation will use rendezvous hashing to map a tablet to one or more hosts. Then it will randomly pick one of those hosts and then randomly pick a scan server on that host. Scan servers that have not had previous failures are chosen first.

This implementation uses the same configuration as ConfigurableScanServerSelector but interprets attemptPlans differently in two ways. First for the server count it will use that to determine how many hosts to choose from. Second it will only consider an attempt plan as failed when servers on all host have failed.

       "attemptPlans":[
           {"servers":"1", "busyTimeout":"10s"},
           {"servers":"3", "busyTimeout":"30s"},
        ]
 

For example given the above attempt plan configuration, the following sequence of events could happen for a tablet.

  1. host32 is chosen and it has 2 severs [host32:1000,host32:1001]. host32:1001 is randomly chosen.
  2. Scan on host32:1001 has a busy timeout.
  3. host32 is chosen again because not all servers have failed. For the server, host32:1000 is chosen because host32:1001 failed.
  4. Scan on host32:1000 has a busy timeout.
  5. Because all servers on host32 have failed, move to the next attemptPlan and choose from three hosts. host32, host40, and host09 are candidates and host09 is randomly picked, then a server from host09:1000 is randomly picked
  6. The scan on host09:1000 succeeds.

This behavior will randomly spread scans against a single tablet across all servers on a host. For example 100 clients are scanning 1 tablet that maps to 1 host with 5 servers, then those scans will evenly spread across the 5 servers on the host.

  • Constructor Details

    • ConfigurableScanServerHostSelector

      public ConfigurableScanServerHostSelector()