mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-23 14:17:13 +00:00
[HER-1633] port IsCrossTopmostAssignedSurtHopDecideRule to heritrix3
* HopCrossesAssignmentLevelDomainDecideRule.java
port H2 IsCrossTopmostAssignedSurtHopDecideRule to H3 under this new name
* PublicSuffixes.java
update comment, public method for 'Assignment Level Domain'/'Assignment Level SURT' term
* AssignmentLevelSurtQueueAssignmentPolicy
renamed TopmostAssignedSurtQueueAssignmentPolicy
This commit is contained in:
1 parent
cb8a374e5d
commit
dd254088e1
5 files changed
+147
-88
No files matched your search
+41
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of the Heritrix web crawler (crawler.archive.org).
|
||||
*
|
||||
* Licensed to the Internet Archive (IA) by one or more individual
|
||||
* contributors.
|
||||
*
|
||||
* The IA licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.archive.crawler.frontier;
|
||||
|
||||
import org.archive.crawler.datamodel.CrawlURI;
|
||||
import org.archive.net.PublicSuffixes;
|
||||
|
||||
/**
|
||||
* Create a queueKey based on the SURT authority, reduced to the
|
||||
* public-suffix-plus-one domain (topmost assignable domain).
|
||||
*
|
||||
* @author gojomo
|
||||
*/
|
||||
public class AssignmentLevelSurtQueueAssignmentPolicy extends
|
||||
SurtAuthorityQueueAssignmentPolicy {
|
||||
private static final long serialVersionUID = -1533545293624791702L;
|
||||
|
||||
@Override
|
||||
public String getClassKey(CrawlURI cauri) {
|
||||
String candidate = super.getClassKey(cauri);
|
||||
candidate = PublicSuffixes.reduceSurtToAssignmentLevel(candidate);
|
||||
return candidate;
|
||||
}
|
||||
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
/* AbstractFrontier
|
||||
*
|
||||
* $Id: AbstractFrontier.java 5053 2007-04-10 02:34:20Z gojomo $
|
||||
*
|
||||
* Created on June 18, 2007
|
||||
*
|
||||
* Copyright (C) 2007 Internet Archive.
|
||||
*
|
||||
* This file is part of the Heritrix web crawler (crawler.archive.org).
|
||||
*
|
||||
* Heritrix is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Heritrix is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser Public License
|
||||
* along with Heritrix; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package org.archive.crawler.frontier;
|
||||
|
||||
import org.archive.crawler.datamodel.CrawlURI;
|
||||
import org.archive.net.PublicSuffixes;
|
||||
|
||||
/**
|
||||
* Create a queueKey based on the SURT authority, reduced to the
|
||||
* public-suffix-plus-one domain (topmost assignable domain).
|
||||
*
|
||||
* @author gojomo
|
||||
*/
|
||||
public class TopmostAssignedSurtQueueAssignmentPolicy extends
|
||||
SurtAuthorityQueueAssignmentPolicy {
|
||||
private static final long serialVersionUID = -1533545293624791702L;
|
||||
|
||||
@Override
|
||||
public String getClassKey(CrawlURI cauri) {
|
||||
String candidate = super.getClassKey(cauri);
|
||||
candidate = PublicSuffixes.reduceSurtToTopmostAssigned(candidate);
|
||||
return candidate;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user