class BucketQueueAssignmentPolicy extends QueueAssignmentPolicy {

    private static final long serialVersionUID = 3L;

    private static final int DEFAULT_NOIP_BITMASK = 1023;
    private static final int DEFAULT_QUEUES_HOSTS_MODULO = 1021;

    protected ServerCache serverCache;
    public ServerCache getServerCache() {
        return this.serverCache;
    }
    @Autowired
    public void setServerCache(ServerCache serverCache) {
        this.serverCache = serverCache;
    }
    
    public String getClassKey(final CrawlURI curi) {<FILL_FUNCTION_BODY>}

    public int maximumNumberOfKeys() {
        return DEFAULT_NOIP_BITMASK + DEFAULT_QUEUES_HOSTS_MODULO + 2;
    }
}

        
        CrawlHost host;
        host = serverCache.getHostFor(curi.getUURI());
        if(host == null) {
            return "NO-HOST";
        } else if(host.getIP() == null) {
            return "NO-IP-".concat(Long.toString(Math.abs((long) host
                    .getHostName().hashCode()) & DEFAULT_NOIP_BITMASK));
        } else {
            return Long.toString(Math.abs((long) host.getIP().hashCode())
                    % DEFAULT_QUEUES_HOSTS_MODULO);
        }
    
<methods>public non-sealed void <init>() ,public abstract java.lang.String getClassKey(org.archive.modules.CrawlURI) ,public java.lang.String getForceQueueAssignment() ,public org.archive.spring.KeyedProperties getKeyedProperties() ,public int maximumNumberOfKeys() ,public void setForceQueueAssignment(java.lang.String) <variables>protected org.archive.spring.KeyedProperties kp,private static final long serialVersionUID