Package com.sleepycat.je.utilint

Examples of com.sleepycat.je.utilint.Tracer


             */

            /*
             * Tracer records.
             */
            Tracer dMsg = new Tracer("Hello there");
            writeAndRead(buffer, dMsg, new Tracer());

            /*
             * LNs
             */
            String data = "abcdef";
View Full Code Here


    public void publish(LogRecord l) {
        if (!env.isReadOnly() &&
      !env.mayNotWrite()) {
            try {
                Tracer newRec = new Tracer(l.getMessage());
                env.getLogManager().log(newRec);
            } catch (DatabaseException e) {
                /* Eat exception. */
                System.err.println("Problem seen while tracing into " +
                                   "the database log:");
View Full Code Here

        checkList = new ArrayList();

        for (int i = 0; i < numIters; i++) {
            /* Add a debug record. */
            Tracer rec = new Tracer("Hello there, rec " + (i + 1));
            logManager.log(rec);

            /* Create, log, and save an IN. */
            byte[] data = new byte[i + 1];
            Arrays.fill(data, (byte) (i + 1));
View Full Code Here

        /* Make test loggable objects. */

        List testRecs = new ArrayList();
        for (int i = 0; i < 10; i++) {
            testRecs.add(new Tracer("Hello there, rec " + (i+1)));
        }

        /* Log three of them, remember their LSNs. */
        List testLsns = new ArrayList();

View Full Code Here

                             int logBufferSize,
                             int fillerLen)
        throws DatabaseException {

        String filler = new String(new byte[fillerLen]);
        Tracer t = new Tracer("okay" + filler + tag );
        assertTrue(logBufferSize > t.getLogSize());
        testRecs.add(t);
        long lsn = logManager.log(t);
        testLsns.add(new Long(lsn));
    }
View Full Code Here

           List testLsns) {
        String stuff = "12345679890123456798901234567989012345679890";
  while (stuff.length() < EnvironmentParams.LOG_MEM_SIZE_MIN) {
      stuff += stuff;
  }
        Tracer t = new Tracer(stuff);
        attemptTooBigItem(logManager, logBufferSize, t, testRecs, testLsns);
    }
View Full Code Here

    private void attemptIOException(LogManager logManager,
                                    FileManager fileManager,
                                    List testRecs,
                                    List testLsns,
                                    boolean forceFlush) {
        Tracer t = new Tracer("ioException");
        FileManager.IO_EXCEPTION_TESTING = true;
        try {

            /*
             * This object might get flushed to disk -- depend on whether
View Full Code Here

         * can iterate through the entire log ... ?
         */
        for (int i = 0; i < numIters; i++) {
            /* Add a debug record. */
            LoggableObject loggableObj =
                new Tracer("Hello there, rec " + (i+1));
            testObjs.add(loggableObj);
            testLsns.add(new Long(logManager.log(loggableObj)));
        }
        /* Flush the log, files. */
  logManager.flush();
 
View Full Code Here

         * Create a log file full of LNs, INs and Debug Records.
         */
        for (int i = 0; i < numIters; i++) {
            /* Add a debug record. */
            LoggableObject loggableObj =
                new Tracer("Hello there, rec " + (i+1));
            testObjs.add(loggableObj);
            testLsns.add(new Long(logManager.log(loggableObj)));

            /* Add an LN. */
            byte [] data = new byte[i+1];
View Full Code Here

                                     LogEntryType.LOG_TRACE);

            Iterator lsnIter = expectedLsns.iterator();
            Iterator valIter = expectedVals.iterator();
            while (reader.readNextEntry()) {
                Tracer rec = (Tracer)reader.getLastObject();
                assertTrue(lsnIter.hasNext());
                assertEquals(reader.getLastLsn(),
           DbLsn.longToLsn((Long) lsnIter.next()));   
                assertEquals((String) valIter.next(), rec.getMessage());
            }
            assertEquals(10, reader.getNumRead());
            assertEquals(expectedOverflows, reader.getNRepeatIteratorReads());

        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.sleepycat.je.utilint.Tracer

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.