1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.archive.crawler.frontier;
26
27 import org.archive.crawler.datamodel.CandidateURI;
28 import org.archive.crawler.framework.CrawlController;
29
30 /***
31 * Establishes a mapping from CrawlURIs to String keys (queue names).
32 *
33 * @author gojomo
34 */
35 public abstract class QueueAssignmentPolicy {
36 /***
37 * Get the String key (name) of the queue to which the
38 * CrawlURI should be assigned.
39 *
40 * Note that changes to the CrawlURI, or its associated
41 * components (such as CrawlServer), may change its queue
42 * assignment.
43 * @param controller This crawls' controller.
44 *
45 * @param cauri CandidateURI to calculate class key for.
46 * @return the String key of the queue to assign the CrawlURI
47 */
48 public abstract String getClassKey(CrawlController controller,
49 CandidateURI cauri);
50
51 /***
52 * Returns the maximum number of different keys this policy
53 * can create. If there is no maximum, -1 is returned (default).
54 *
55 * @return Maximum number of different keys, or -1 if unbounded.
56 */
57 public int maximumNumberOfKeys() {
58 return -1;
59 }
60 }