Package com.sleepycat.je

Examples of com.sleepycat.je.PreloadStats


                    }
                }
            };
            thread.start();
        }
        final PreloadStats stats;
        try {
            stats = db.preload(new PreloadConfig().setLoadLNs(loadLNs));
        } finally {
            if (thread != null) {
                thread.interrupt();
            }
        }
        if (thread != null) {
            try {
                thread.join();
            } catch (InterruptedException e) {
                e.printStackTrace(out);
            }
        }

        /* Checkpoint to reset the memory budget. */
        db.getEnvironment().checkpoint(new CheckpointConfig().setForce(true));

        return stats.getStatus();
    }
View Full Code Here


                        DatabaseId id2 = o2.getId();
                        return id1.compareTo(id2);
                    }
                });

            PreloadStats pstats = new PreloadStats();
            PreloadProcessor callback = new PreloadProcessor
                (this, maxBytes, targetTime, pstats, config);
            int nDbs = dbImpls.length;
            long[] rootLsns = new long[nDbs];
            for (int i = 0; i < nDbs; i += 1) {
                rootLsns[i] = dbImpls[i].getTree().getRootLsn();
            }
            SortedLSNTreeWalker walker =
                new PreloadLSNTreeWalker(dbImpls, rootLsns, callback, config);
            try {
                walker.walk();
                callback.close();
            } catch (HaltPreloadException HPE) {
                pstats.setStatus(HPE.getStatus());
            }

            assert LatchSupport.countLatchesHeld() == 0;
            return pstats;
        } catch (Error E) {
View Full Code Here

     */
    public long count()
        throws DatabaseException {

        try {
            PreloadStats pstats = new PreloadStats();

            CountProcessor callback = new CountProcessor(envImpl, pstats);
            ExceptionPredicate excPredicate = new CountExceptionPredicate();
            SortedLSNTreeWalker walker =
                new SortedLSNTreeWalker(new DatabaseImpl[] { this },
                                        false /*setDbState*/,
                                        new long[] { tree.getRootLsn() },
                                        callback, null, excPredicate);
            walker.walk();

            assert LatchSupport.countLatchesHeld() == 0;
            return pstats.getNLNsLoaded();
        } catch (Error E) {
            envImpl.invalidate(E);
            throw E;
        }
    }
View Full Code Here

    ("maxBytes parameter to Database.preload() was specified as " +
     maxBytes + " bytes \nbut the cache is only " +
     cacheBudget + " bytes.");
  }

  PreloadStats ret = new PreloadStats();
  PreloadProcessor callback =
      new PreloadProcessor(envImpl, maxBytes, targetTime, ret);
  SortedLSNTreeWalker walker =
      new PreloadLSNTreeWalker(this, callback, config);
  try {
View Full Code Here

                    }
                }
            }
        };
        thread.start();
        final PreloadStats stats =
            db.preload(new PreloadConfig().setLoadLNs(loadLNs));
        thread.interrupt();
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace(out);
        }

        /* Checkpoint to reset the memory budget. */
        db.getEnvironment().checkpoint(new CheckpointConfig().setForce(true));

        return stats.getStatus();
    }
View Full Code Here

                     "specified as " +
                     maxBytes + " bytes \nbut the cache is only " +
                     cacheBudget + " bytes.");
            }

            PreloadStats pstats = new PreloadStats();
            PreloadProcessor callback = new PreloadProcessor
                (envImpl, maxBytes, targetTime, pstats, config);
            SortedLSNTreeWalker walker =
                new PreloadLSNTreeWalker(this, callback, config);
            walker.setPassNullLSNNodes(true);
            try {
                walker.walk();
            } catch (HaltPreloadException HPE) {
                pstats.setStatus(HPE.getStatus());
            }

            assert LatchSupport.countLatchesHeld() == 0;
            return pstats;
        } catch (Error E) {
View Full Code Here

     */
    public long count()
        throws DatabaseException {

        try {
            PreloadStats pstats = new PreloadStats();

            CountProcessor callback = new CountProcessor(envImpl, pstats);
            ExceptionPredicate excPredicate = new CountExceptionPredicate();
            SortedLSNTreeWalker walker =
                new SortedLSNTreeWalker(this, false /* setDbState */,
                                        tree.getRootLsn(), callback, null,
                                        excPredicate);
            /* Don't descend down into the dup tree. Use the DupCountLN. */
            walker.setProcessDupTree(false);
            walker.setPassNullLSNNodes(true);
            walker.walk();

            assert LatchSupport.countLatchesHeld() == 0;
            return pstats.getNLNsLoaded();
        } catch (Error E) {
            envImpl.invalidate(E);
            throw E;
        }
    }
View Full Code Here

TOP

Related Classes of com.sleepycat.je.PreloadStats

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.