@Override public byte[] info() { final TokenBuilder tb = new TokenBuilder(LI_STRUCTURE).add(SORTED_LIST).add(NL); final IndexStats stats = new IndexStats(data); for (int m = 1; m < size; ++m) { final int oc = len[m]; if (stats.adding(oc)) stats.add(key(m)); } stats.print(tb); return tb.finish(); }
@Override public synchronized byte[] info(final MainOptions options) { final TokenBuilder tb = new TokenBuilder(); final long l = inX.length() + inY.length() + inZ.length(); tb.add(LI_NAMES).add(data.meta.ftinclude).add(NL); tb.add(LI_SIZE + Performance.format(l, true) + NL); final IndexStats stats = new IndexStats(options.get(MainOptions.MAXSTAT)); addOccs(stats); stats.print(tb); return tb.finish(); }
@Override public byte[] info(final MainOptions options) { final TokenBuilder tb = new TokenBuilder(); tb.add(LI_STRUCTURE).add(HASH).add(NL); tb.add(LI_NAMES).add(data.meta.names(type)).add(NL); final IndexStats stats = new IndexStats(options.get(MainOptions.MAXSTAT)); final int s = values.size(); for (int p = 1; p <= s; p++) { final int oc = lenList.get(p); if (oc > 0 && stats.adding(oc)) stats.add(values.key(p), oc); } stats.print(tb); return tb.finish(); }
private void doCheck( File[] replicas, ArrayList<String> replicasList, ConcurrentHashMap<String, BlobStatus> blobIdToStatusMap, AtomicLong totalKeysProcessed) throws IOException, InterruptedException { DumpData dumpData = new DumpData(map, true); CountDownLatch countDownLatch = new CountDownLatch(replicas.length); IndexStats indexStats = new IndexStats(); for (File replica : replicas) { Thread thread = new Thread( new ReplicaProcessorForBlobs( replica, replicasList, blobIdToStatusMap, totalKeysProcessed, dumpData, countDownLatch, indexStats)); thread.start(); thread.join(); } countDownLatch.await(); logger.info("Total Keys Processed " + totalKeysProcessed.get()); logger.info("Total Put Records " + indexStats.getTotalPutRecords().get()); logger.info("Total Delete Records " + indexStats.getTotalDeleteRecords().get()); logger.info("Total Duplicate Put Records " + indexStats.getTotalDuplicatePutRecords().get()); logger.info( "Total Delete before Put Records " + indexStats.getTotalDeleteBeforePutRecords().get()); logger.info( "Total Put after Delete Records " + indexStats.getTotalPutAfterDeleteRecords().get()); logger.info( "Total Duplicate Delete Records " + indexStats.getTotalDuplicateDeleteRecords().get()); }
/** * Collects all tokens and their sizes found in the index structure. * * @param stats statistics */ private void addOccs(final IndexStats stats) { int i = 0; final int tl = tp.length; while (i < tl && tp[i] == -1) ++i; int p = tp[i], j = i + 1; while (j < tl && tp[j] == -1) ++j; final int max = tp[tl - 1]; while (p < max) { final int oc = size(p, i); if (stats.adding(oc)) stats.add(inY.readBytes(p, i), oc); p += i + ENTRY; if (p == tp[j]) { i = j; while (j + 1 < tl && tp[++j] == -1) ; } } }