public class AlphaPartitionedIndex extends Object implements ResourceIndex
The remote index can be duplicated for failover and load balancing. Configuration is done with a map file which contains the range for each remote index partition and the urls to all instances of the partition.
Format of mapfile:
<partition name> <range start> <range end> <url to index partition> [<url to alternative index partition> ...]Example:
part_a apple.com/ http://part_a1.foo.com http://part_a2.foo.com part_b apple.com/ banana.com/ http://part_b1.foo.com http://part_b2.foo.com part_c banana.com/ cups.com/ http://part_c1.foo.com http://part_c2.foo.com part_d cups.com/ zorro.com/ http://part_d1.foo.com http://part_d2.foo.com
RemoteResourceIndex
Modifier and Type | Field and Description |
---|---|
static String |
RANGE_CHECK_INTERVAL
config name for interval, in seconds, to check if the map file changed
|
static String |
RANGE_MAP_PATH
config name for path where map file is found
|
Constructor and Description |
---|
AlphaPartitionedIndex() |
Modifier and Type | Method and Description |
---|---|
String |
canonicalize(String url) |
UrlCanonicalizer |
getCanonicalizer() |
long |
getCheckInterval() |
String |
getMapPath() |
protected RangeGroup |
getRangeGroupForRequest(WaybackRequest wbRequest) |
SearchResults |
query(WaybackRequest wbRequest)
Transform a WaybackRequest into a ResourceResults.
|
void |
setCanonicalizer(UrlCanonicalizer canonicalizer) |
void |
setCheckInterval(long checkInterval) |
void |
setMapPath(String mapPath) |
void |
shutdown()
Release any resources used by this ResourceIndex cleanly
|
public static String RANGE_MAP_PATH
public static String RANGE_CHECK_INTERVAL
protected RangeGroup getRangeGroupForRequest(WaybackRequest wbRequest) throws BadQueryException, ResourceIndexNotAvailableException
public SearchResults query(WaybackRequest wbRequest) throws ResourceIndexNotAvailableException, ResourceNotInArchiveException, BadQueryException, AccessControlException
ResourceIndex
query
in interface ResourceIndex
wbRequest
- WaybackRequest object from RequestParserResourceIndexNotAvailableException
- if the ResourceIndex
is not available (remote host down, local files missing, etc)ResourceNotInArchiveException
- if the ResourceIndex could be
contacted, but no SearchResult objects matched the requestBadQueryException
- if the WaybackRequest is lacking information
required to make a reasonable search of this ResourceIndexAccessControlException
- if SearchResult objects actually matched,
but could not be returned due to AccessControl restrictions
(robots.txt documents, Administrative URL blocks, etc)public String canonicalize(String url) throws org.apache.commons.httpclient.URIException
url
- org.apache.commons.httpclient.URIException
public long getCheckInterval()
public void setCheckInterval(long checkInterval)
checkInterval
- the checkInterval to setpublic String getMapPath()
public void setMapPath(String mapPath)
mapPath
- the mapPath to setpublic UrlCanonicalizer getCanonicalizer()
public void setCanonicalizer(UrlCanonicalizer canonicalizer)
public void shutdown() throws IOException
ResourceIndex
shutdown
in interface ResourceIndex
IOException
- for usual causesCopyright © 2005–2015 IIPC. All rights reserved.