Refine search
SessionManager sessionManager = new HashSessionManager(); sessionManager.setMaxInactiveInterval( config.getInt(DrillOnYarnConfig.HTTP_SESSION_MAX_IDLE_SECS));
HashedSession session = restoreSession(in, null); addSession(session, false); session.didActivate(); return session; try {in.close();} catch (Exception x) {__log.ignore(x);} if (isDeleteUnrestorableSessions() && file.exists() && file.getParentFile().equals(_storeDir) ) LOG.warn("Deleting file for unrestorable session "+idInCuster, error); __log.warn("Problem restoring session "+idInCuster, error);
if (!file.exists()) if (LOG.isDebugEnabled()) LOG.debug("Not loading: {}",file); HashedSession session = restoreSession(in,null); addSession(session,false); session.didActivate(); return session; if (isDeleteUnrestorableSessions() && file.exists() && file.getParentFile().equals(_storeDir) ) LOG.warn("Deleting file for unrestorable session "+idInCuster, error);
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { __log.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
if (isStopping() || isStopped()) return; __log.debug("Scavenging sessions at {}", now); __log.warn("Problem scavenging sessions", e); __log.warn("Problem idling session "+ session.getId(), e);
if (isStopping() || isStopped()) return; __log.warn("Problem scavenging sessions", e); __log.warn("Problem idling session "+ session.getId(), e);
/** * @see org.eclipse.jetty.servlet.AbstractSessionManager#doStart() */ @Override public void doStart() throws Exception { super.doStart(); _timerStop=false; ServletContext context = ContextHandler.getCurrentContext(); if (context!=null) _timer=(Timer)context.getAttribute("org.eclipse.jetty.server.session.timer"); if (_timer==null) { _timerStop=true; _timer=new Timer("HashSessionScavenger-"+__id++, true); } setScavengePeriod(getScavengePeriod()); if (_storeDir!=null) { if (!_storeDir.exists()) _storeDir.mkdirs(); if (!_lazyLoad) restoreSessions(); } setSavePeriod(getSavePeriod()); }
_timer = getSessionHandler().getServer().getBean(Scheduler.class); if (_timer == null) addBean(_timer,true); addBean(_timer,false); setScavengePeriod(getScavengePeriod()); restoreSessions(); setSavePeriod(getSavePeriod());
@Override public void setMaxInactiveInterval(int seconds) { super.setMaxInactiveInterval(seconds); if (_dftMaxIdleSecs>0&&_scavengePeriodMs>_dftMaxIdleSecs*1000L) setScavengePeriod((_dftMaxIdleSecs+9)/10); }
private void restoreSessions() { try { HashSessionManager hashSessionManager = (HashSessionManager) jettySessionManager; hashSessionManager.setStoreDirectory(FileUtils.createDirIfNotExists(sessionStoreDir, "Session persistence")); hashSessionManager.setSavePeriod(60); hashSessionManager.restoreSessions(); } catch (Exception e) { LOG.warning("Cannot restore sessions"); } } public void addWebSocketServlets() {
@Provides @Singleton public org.eclipse.jetty.server.SessionManager provideSessionManager(Config config) { HashSessionManager sessionManager = new HashSessionManager(); sessionManager.getSessionCookieConfig().setMaxAge(config.getInt("network.session_cookie_max_age")); return sessionManager; } }
@Override protected void addSession(AbstractSession session) { if (isRunning()) _sessions.put(session.getClusterId(),(HashedSession)session); }
private void persistSession(WebAppContext webApp) { String storeDir = getStoreDir(); SessionManager sm = webApp.getSessionHandler().getSessionManager(); if (sm instanceof HashSessionManager) { ((HashSessionManager)sm).setStoreDirectory(new File(storeDir)); return ; } HashSessionManager hsm = new HashSessionManager(); hsm.setStoreDirectory(new File(storeDir)); SessionHandler sh = new SessionHandler(); sh.setSessionManager(hsm); webApp.setSessionHandler(sh); }
webAppContext.setContextPath(this.getContextPath()); webAppContext.setWar(getWebAppDir().getAbsolutePath()); webAppContext.setSessionHandler(new HashSessionManager().getSessionHandler()); webAppContext.setMaxFormContentSize(MAX_FORM_CONTENT_SIZE);
jettyServer.setSessionIdManager(idManager); final HashSessionManager manager = new HashSessionManager(); if (config.session_timeout > 0) { manager.setMaxInactiveInterval(config.session_timeout * 60);
@Override @ManagementOperation(description = "Session scavenger period in seconds") public int getScavengePeriod() { return super.getScavengePeriod(); }
HashedSession session = restoreSession(in, null); addSession(session, false); session.didActivate(); return session; try {in.close();} catch (Exception x) {__log.ignore(x);} if (isDeleteUnrestorableSessions() && file.exists() && file.getParentFile().equals(_storeDir) ) LOG.warn("Deleting file for unrestorable session "+idInCuster, error); __log.warn("Problem restoring session "+idInCuster, error);
if (!file.exists()) if (LOG.isDebugEnabled()) LOG.debug("Not loading: {}",file); HashedSession session = restoreSession(in,null); addSession(session,false); session.didActivate(); return session; if (isDeleteUnrestorableSessions() && file.exists() && file.getParentFile().equals(_storeDir) ) LOG.warn("Deleting file for unrestorable session {} {}",idInCuster,error); __log.debug(error);
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { __log.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
if (isStopping() || isStopped()) return; __log.debug("Scavenging sessions at {}", now); __log.warn("Problem scavenging sessions", e); __log.warn("Problem idling session "+ session.getId(), e);