Package org.lealone.engine

Examples of org.lealone.engine.SessionRemote


    @Override
    public synchronized void flush(Session session) {
        HBaseSession s = (HBaseSession) session;
        if (s.getRegionServer() != null) {
            SessionRemote sr = null;
            CommandRemote cr = null;
            try {
                sr = SessionRemotePool.getMasterSessionRemote(s.getOriginalProperties());
                cr = SessionRemotePool.getCommandRemote(sr, "ALTER SEQUENCE " + getSQL() + " NEXT VALUE MARGIN", null, 1);
                //cr.executeUpdate();
View Full Code Here


    public static SessionRemote getMasterSessionRemote(Properties info) {
        return getSessionRemote(info, HBaseUtils.getMasterURL());
    }

    public static SessionRemote getSessionRemote(Properties info, String url) {
        SessionRemote sr = getQueue(url).poll();

        if (sr == null || sr.isClosed()) {
            byte[] userPasswordHash = null;
            byte[] filePasswordHash = null;
            Properties prop = new Properties();
            String key;
            for (Object o : info.keySet()) {
                key = o.toString();

                if (key.equalsIgnoreCase("_userPasswordHash_"))
                    userPasswordHash = (byte[]) info.get(key);
                else if (key.equalsIgnoreCase("_filePasswordHash_"))
                    filePasswordHash = (byte[]) info.get(key);
                else
                    prop.setProperty(key, info.getProperty(key));

            }
            ConnectionInfo ci = new ConnectionInfo(url, prop);
            ci.setUserPasswordHash(userPasswordHash);
            ci.setFilePasswordHash(filePasswordHash);
            sr = (SessionRemote) new SessionRemote(ci).connectEmbeddedOrServer(false);
        }

        return sr;
    }
View Full Code Here

            queue.offer(sr);
    }

    public static CommandRemote getCommandRemote(HBaseSession originalSession, Prepared prepared, //
            String url, String sql) throws Exception {
        SessionRemote sessionRemote = originalSession.getSessionRemote(url);
        if (sessionRemote != null && sessionRemote.isClosed())
            sessionRemote = null;
        boolean isNew = false;
        if (sessionRemote == null) {
            isNew = true;
            sessionRemote = getSessionRemote(originalSession.getOriginalProperties(), url);
        }

        if (sessionRemote.getTransaction() == null)
            sessionRemote.setTransaction(originalSession.getTransaction());

        if (isNew)
            originalSession.addSessionRemote(url, sessionRemote);

        return getCommandRemote(sessionRemote, sql, prepared.getParameters(), prepared.getFetchSize());
View Full Code Here

                session.getDatabase().addDDLRedoRecord(session, sql);
                return updateCount;
            } finally {
            }
        } else {
            SessionRemote sr = null;
            CommandRemote cr = null;
            try {
                sr = SessionRemotePool.getMasterSessionRemote(session.getOriginalProperties());
                cr = SessionRemotePool.getCommandRemote(sr, sql, getParameters(), dc.getFetchSize());
                int updateCount = cr.executeUpdate();
View Full Code Here

            try {
                return dc.query(maxRows);
            } finally {
            }
        } else {
            SessionRemote sr = null;
            CommandRemote cr = null;
            try {
                sr = SessionRemotePool.getMasterSessionRemote(session.getOriginalProperties());
                cr = SessionRemotePool.getCommandRemote(sr, sql, getParameters(), dc.getFetchSize());
                ResultInterface ri = cr.executeQuery(maxRows, false);
View Full Code Here

            }
            // this will return an embedded or server connection
            if (ci.getSession() != null)
                session = ci.getSession();
            else
                session = new SessionRemote(ci).connectEmbeddedOrServer(false);
            trace = session.getTrace();
            int id = getNextId(TraceObject.CONNECTION);
            setTrace(trace, TraceObject.CONNECTION, id);
            this.user = ci.getUserName();
            if (isInfoEnabled()) {
View Full Code Here

TOP

Related Classes of org.lealone.engine.SessionRemote

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.