Package net.yacy.kelondro.index

Examples of net.yacy.kelondro.index.BinSearch


        List<BinSearch> table = new ArrayList<BinSearch>();
        while (hostScore.size() > 10) {
            List<byte[]> smallest = hostScore.lowerHalf();
            if (smallest.size() == 0) break; // should never happen but this ensures termination of the loop
            Log.logInfo("BlockRank", "index evaluation: computed partition of size " + smallest.size());
            table.add(new BinSearch(smallest, 6));
            for (byte[] host: smallest) hostScore.delete(host);
        }
        if (hostScore.size() > 0) {
            ArrayList<byte[]> list = new ArrayList<byte[]>();
            for (byte[] entry: hostScore) list.add(entry);
            Log.logInfo("BlockRank", "index evaluation: computed last partition of size " + list.size());
            table.add(new BinSearch(list, 6));
        }
       
        // the last table entry has now a list of host hashes that has the most references
        int binTables = Math.min(16, table.size());
        BinSearch[] newTables = new BinSearch[binTables];
View Full Code Here


        try {
            for (int i = 0; i < count; i++) {
                ybrName = "YBR-4-" + Digest.encodeHex(i, 2) + ".idx";
                f = new File(rankingPath, ybrName);
                if (f.exists()) {
                    ybrTables[i] = new BinSearch(FileUtils.read(f), 6);
                } else {
                    ybrTables[i] = null;
                }
            }
        } catch (final IOException e) {
View Full Code Here

        final List<BinSearch> table = new ArrayList<BinSearch>();
        while (hostScore.size() > 10) {
            final List<byte[]> smallest = hostScore.lowerHalf();
            if (smallest.size() == 0) break; // should never happen but this ensures termination of the loop
            Log.logInfo("BlockRank", "index evaluation: computed partition of size " + smallest.size());
            table.add(new BinSearch(smallest, 6));
            for (final byte[] host: smallest) hostScore.delete(host);
        }
        if (hostScore.size() > 0) {
            final ArrayList<byte[]> list = new ArrayList<byte[]>();
            for (final byte[] entry: hostScore) list.add(entry);
            Log.logInfo("BlockRank", "index evaluation: computed last partition of size " + list.size());
            table.add(new BinSearch(list, 6));
        }

        // the last table entry has now a list of host hashes that has the most references
        final int binTables = Math.min(16, table.size());
        final BinSearch[] newTables = new BinSearch[binTables];
View Full Code Here

        try {
            for (int i = 0; i < count; i++) {
                ybrName = "YBR-4-" + Digest.encodeHex(i, 2) + ".idx";
                f = new File(rankingPath, ybrName);
                if (f.exists()) {
                    ybrTables[i] = new BinSearch(FileUtils.read(f), 6);
                } else {
                    ybrTables[i] = null;
                }
            }
        } catch (final IOException e) {
View Full Code Here

TOP

Related Classes of net.yacy.kelondro.index.BinSearch

Copyright © 2018 www.massapicom. 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.