Examples of HandleSet


Examples of net.yacy.kelondro.index.HandleSet

            result = c1;
        }
        if (result == null) return null;
        // remove the failed urls
        synchronized (this.removeDelayedURLs) {
            final HandleSet s = this.removeDelayedURLs.get(termHash);
            if (s != null) result.removeEntries(s);
        }
        return result;
    }
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

            }
        }
    }

    public void removeDelayed(final byte[] termHash, final HandleSet urlHashes) {
        HandleSet r;
        synchronized (this.removeDelayedURLs) {
            r = this.removeDelayedURLs.get(termHash);
        }
        if (r == null) {
            r = new HandleSet(URIMetadataRow.rowdef.primaryKeyLength, URIMetadataRow.rowdef.objectOrder, 0);
        }
        try {
            r.putAll(urlHashes);
        } catch (final RowSpaceExceededException e) {
            try {remove(termHash, urlHashes);} catch (final IOException e1) {}
            return;
        }
        synchronized (this.removeDelayedURLs) {
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

            this.removeDelayedURLs.put(termHash, r);
        }
    }

    public void removeDelayed(final byte[] termHash, final byte[] urlHashBytes) {
        HandleSet r;
        synchronized (this.removeDelayedURLs) {
            r = this.removeDelayedURLs.get(termHash);
        }
        if (r == null) {
            r = new HandleSet(URIMetadataRow.rowdef.primaryKeyLength, URIMetadataRow.rowdef.objectOrder, 0);
        }
        try {
            r.put(urlHashBytes);
        } catch (final RowSpaceExceededException e) {
            try {remove(termHash, urlHashBytes);} catch (final IOException e1) {}
            return;
        }
        synchronized (this.removeDelayedURLs) {
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

            this.removeDelayedURLs.put(termHash, r);
        }
    }

    public void removeDelayed() throws IOException {
        final HandleSet words = new HandleSet(URIMetadataRow.rowdef.primaryKeyLength, URIMetadataRow.rowdef.objectOrder, 0); // a set of url hashes where a worker thread tried to work on, but failed.
        synchronized (this.removeDelayedURLs) {
            for (final byte[] b: this.removeDelayedURLs.keySet()) try {words.put(b);} catch (final RowSpaceExceededException e) {}
        }

        synchronized (this.removeDelayedURLs) {
            for (final byte[] b: words) {
                final HandleSet urls = this.removeDelayedURLs.remove(b);
                if (urls != null) remove(b, urls);
            }
        }
        this.countCache.clear();
    }
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

        public RemoveReducer(final HandleSet urlHashes) {
            this.urlHashes = urlHashes;
        }

        public RemoveReducer(final byte[] urlHashBytes) {
            this.urlHashes = new HandleSet(URIMetadataRow.rowdef.primaryKeyLength, URIMetadataRow.rowdef.objectOrder, 0);
            try {
                this.urlHashes.put(urlHashBytes);
            } catch (final RowSpaceExceededException e) {
                Log.logException(e);
            }
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

        }
        return h;
    }
   
    public static final HandleSet words2hashesHandles(final Set<String> words) {
        final HandleSet hashes = new HandleSet(WordReferenceRow.urlEntryRow.primaryKeyLength, WordReferenceRow.urlEntryRow.objectOrder, words.size());
        for (final String word: words)
            try {
                hashes.put(word2hash(word));
            } catch (RowSpaceExceededException e) {
                Log.logException(e);
                return hashes;
            }
        return hashes;
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

            }
        return hashes;
    }
   
    public static final HandleSet words2hashesHandles(final String[] words) {
        final HandleSet hashes = new HandleSet(WordReferenceRow.urlEntryRow.primaryKeyLength, WordReferenceRow.urlEntryRow.objectOrder, words.length);
        for (final String word: words)
            try {
                hashes.put(word2hash(word));
            } catch (RowSpaceExceededException e) {
                Log.logException(e);
                return hashes;
            }
        return hashes;
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

        for (Index i: tables.values()) m += i.mem();
        return m;
    }
   
    public final byte[] smallestKey() {
        HandleSet keysort = new HandleSet(this.rowdef.primaryKeyLength, this.rowdef.objectOrder, this.tables.size());
        for (Index oi: this.tables.values()) try {
            keysort.put(oi.smallestKey());
        } catch (RowSpaceExceededException e) {
            Log.logException(e);
        }
        return keysort.smallestKey();
    }
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

        }
        return keysort.smallestKey();
    }
   
    public final byte[] largestKey() {
        HandleSet keysort = new HandleSet(this.rowdef.primaryKeyLength, this.rowdef.objectOrder, this.tables.size());
        for (Index oi: this.tables.values()) try {
            keysort.put(oi.largestKey());
        } catch (RowSpaceExceededException e) {
            Log.logException(e);
        }
        return keysort.largestKey();
    }
View Full Code Here

Examples of net.yacy.kelondro.index.HandleSet

     * @param urlhash
     * @return true, if the entry was removed; false if not
     */
    public boolean removeByURLHash(final byte[] urlhashBytes) {
        try {
            final HandleSet urlHashes = Base64Order.enhancedCoder.getHandleSet(12, 1);
            urlHashes.put(urlhashBytes);
            boolean ret = false;
            try {ret |= noloadStack.remove(urlHashes) > 0;} catch (final IOException e) {}
            try {ret |= coreStack.remove(urlHashes) > 0;} catch (final IOException e) {}
            try {ret |= limitStack.remove(urlHashes) > 0;} catch (final IOException e) {}
            try {ret |= remoteStack.remove(urlHashes) > 0;} catch (final IOException e) {}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.