Examples of Latch


Examples of com.sleepycat.je.latch.Latch

        /* See if we're configured to do a checksum when reading in objects. */
        doChecksumOnRead =
            configManager.getBoolean(EnvironmentParams.LOG_CHECKSUM_READ);

        logWriteLatch = new Latch(DEBUG_NAME);
        readBufferSize =
            configManager.getInt(EnvironmentParams.LOG_FAULT_READ_SIZE);

        /* Do the stats definitions. */
        stats = new StatGroup(GROUP_NAME, GROUP_DESC);
View Full Code Here

Examples of com.sleepycat.je.latch.Latch

                }
            }

            /* Cache of files. */
            fileCache = new FileCache(configManager);
            fileCacheLatch = new Latch(DEBUG_NAME + "_fileCache");

            /* Start out as if no log existed. */
            currentFileNum = 0L;
            nextAvailableLsn =
                DbLsn.makeLsn(currentFileNum, firstLogEntryOffset());
View Full Code Here

Examples of com.sleepycat.je.latch.Latch

    FSyncManager(EnvironmentImpl envImpl) {
        timeout = envImpl.getConfigManager().getDuration
            (EnvironmentParams.LOG_FSYNC_TIMEOUT);
        this.envImpl = envImpl;

        fsyncLatch = new Latch("fsyncLatch");
        fsyncInProgress = false;
        nextFSyncWaiters = new FSyncGroup(timeout, envImpl);

        stats = new StatGroup(LogStatDefinition.FSYNCMGR_GROUP_NAME,
                              LogStatDefinition.FSYNCMGR_GROUP_DESC);
View Full Code Here

Examples of com.sleepycat.je.latch.Latch

    /**
     * Creates a new handle but does not initialize it.  The init method must
     * be called before using the handle to access the file.
     */
    FileHandle(long fileNum, String label) {
        fileLatch = new Latch("file_" + label + "_fileHandle");
        this.fileNum = fileNum;
    }
View Full Code Here

Examples of com.sleepycat.je.latch.Latch

    LogBuffer(int capacity, EnvironmentImpl env)
        throws DatabaseException {

        buffer = ByteBuffer.allocate(capacity);
        readLatch = new Latch(DEBUG_NAME);
        reinit();
    }
View Full Code Here

Examples of com.sleepycat.je.latch.Latch

        startupTracker.start(Phase.TOTAL_ENV_OPEN);

        try {
            this.envHome = envHome;
            envState = DbEnvState.INIT;
            mapTreeRootLatch = new Latch("MapTreeRoot");
            exceptionListenerUsers = Collections.synchronizedSet
                (new HashSet<ExceptionListenerUser>());

            /* Do the stats definition. */
            stats = new StatGroup(ENV_GROUP_NAME, ENV_GROUP_DESC);
View Full Code Here

Examples of com.sleepycat.je.latch.Latch

                  EnvironmentImpl envImpl)
        throws DatabaseException {

        this.fileManager = fileManager;
        this.envImpl = envImpl;
        bufferPoolLatch = new Latch(DEBUG_NAME + "_FullLatch");

        /* Configure the pool. */
        DbConfigManager configManager = envImpl.getConfigManager();
        runInMemory = envImpl.isMemOnly();
        reset(configManager);
View Full Code Here

Examples of org.apache.derby.iapi.services.locks.Latch

      control = null;
    }
  }

  private Latch getNextLock(Control control) {
    Latch lock = null;
//System.out.println("next lock ");
    if (grantedList != null) {
      if (grantedList.hasNext()) {
        lock = (Lock) grantedList.next();
      }
View Full Code Here

Examples of org.apache.derby.iapi.services.locks.Latch

  public Object nextElement() {

    if (!hasMoreElements())
      throw new NoSuchElementException();

    Latch ret = nextLock;

    nextLock = null;
    return ret;
  }
View Full Code Here

Examples of org.cometd.javascript.Latch

    @Test
    public void testOutgoingExtensionExceptionCallback() throws Exception
    {
        defineClass(Latch.class);
        evaluateScript("var latch = new Latch(1);");
        Latch latch = (Latch)get("latch");
        evaluateScript("var connectLatch = new Latch(1);");
        Latch connectLatch = get("connectLatch");
        evaluateScript("" +
                "cometd.configure({url: '" + cometdURL + "', logLevel: '" + getLogLevel() + "'});" +
                "cometd.addListener('/meta/connect', function(message) { connectLatch.countDown(); });" +
                "cometd.registerExtension('testext', {" +
                "   outgoing: function(message) { throw 'test'; }" +
                "});" +
                "" +
                "cometd.onExtensionException = function(exception, extensionName, outgoing, message) " +
                "{" +
                "   if (exception === 'test' && extensionName === 'testext' && outgoing === true)" +
                "   {" +
                "       this.unregisterExtension(extensionName);" +
                "       latch.countDown();" +
                "   }" +
                "};" +
                "" +
                "cometd.handshake();");
        Assert.assertTrue(latch.await(5000));

        Assert.assertTrue(connectLatch.await(5000));

        evaluateScript("cometd.disconnect(true);");
    }
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.