Package org.hsqldb_voltpatches.lib

Examples of org.hsqldb_voltpatches.lib.LongKeyIntValueHashMap


        this.database = database;
        schemaMap     = new IntKeyHashMap();
        sqlLookup     = new LongKeyHashMap();
        csidMap       = new LongKeyHashMap();
        sessionUseMap = new LongKeyHashMap();
        useMap        = new LongKeyIntValueHashMap();
        next_cs_id    = 0;
    }
View Full Code Here


     * @param csid the compiled statement identifier
     * @param sessionID the session identifier
     */
    private void linkSession(long csid, long sessionID) {

        LongKeyIntValueHashMap scsMap;

        scsMap = (LongKeyIntValueHashMap) sessionUseMap.get(sessionID);

        if (scsMap == null) {
            scsMap = new LongKeyIntValueHashMap();

            sessionUseMap.put(sessionID, scsMap);
        }

        int count = scsMap.get(csid, 0);

        scsMap.put(csid, count + 1);

        if (count == 0) {
            useMap.put(csid, useMap.get(csid, 0) + 1);
        }
    }
View Full Code Here

            // statement was never added
            return;
        }

        LongKeyIntValueHashMap scsMap =
            (LongKeyIntValueHashMap) sessionUseMap.get(sessionID);

        if (scsMap == null) {

            // statement already removed due to invalidation
            return;
        }

        int sessionUseCount = scsMap.get(csid, 0);

        if (sessionUseCount == 0) {

            // statement already removed due to invalidation
        } else if (sessionUseCount == 1 || freeAll) {
            scsMap.remove(csid);

            int usecount = useMap.get(csid, 0);

            if (usecount == 0) {

                // statement already removed due to invalidation
            } else if (usecount == 1) {
                Statement cs = (Statement) csidMap.remove(csid);

                if (cs != null) {
                    int schemaid = cs.getSchemalName().hashCode();
                    LongValueHashMap sqlMap =
                        (LongValueHashMap) schemaMap.get(schemaid);
                    String sql = (String) sqlLookup.remove(csid);

                    sqlMap.remove(sql);
                }

                useMap.remove(csid);
            } else {
                useMap.put(csid, usecount - 1);
            }
        } else {
            scsMap.put(csid, sessionUseCount - 1);
        }
    }
View Full Code Here

     *
     * @param sessionID the session identifier
     */
    synchronized void removeSession(long sessionID) {

        LongKeyIntValueHashMap scsMap;
        long                   csid;
        Iterator               i;

        scsMap = (LongKeyIntValueHashMap) sessionUseMap.remove(sessionID);

        if (scsMap == null) {
            return;
        }

        i = scsMap.keySet().iterator();

        while (i.hasNext()) {
            csid = i.nextLong();

            int usecount = useMap.get(csid, 1) - 1;
View Full Code Here

TOP

Related Classes of org.hsqldb_voltpatches.lib.LongKeyIntValueHashMap

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.