public Handle(THandleIdentifier tHandleIdentifier) { this.handleId = new HandleIdentifier(tHandleIdentifier); }
public UUID getSessionId() { return getHandleIdentifier().getPublicId(); }
private void removeSafeQueryInfo(OperationHandle operationHandle) { synchronized (webuiLock) { String opKey = operationHandle.getHandleIdentifier().toString(); // remove from list of live operations QueryInfo display = liveQueryInfos.remove(opKey); if (display == null) { LOG.debug("Unexpected display object value of null for operation {}", opKey); } else if (historicalQueryInfos != null) { // add to list of saved historic operations historicalQueryInfos.put(opKey, display); } } }
HandleIdentifier handleIdentifier = new HandleIdentifier(sessionHandle.getPublicId(), sessionHandle.getSecretId()); SessionHandle hiveSessionHandle = new SessionHandle(new TSessionHandle(handleIdentifier.toTHandleIdentifier())); try { cliService.createSessionWithSessionHandle(hiveSessionHandle, userName, password, new HashMap<>()); LensSessionHandle restoredSession = new LensSessionHandle(hiveSessionHandle.getHandleIdentifier().getPublicId(), hiveSessionHandle.getHandleIdentifier().getSecretId()); SESSION_MAP.put(restoredSession.getPublicId().toString(), restoredSession);
public TSessionHandle toTSessionHandle() { TSessionHandle tSessionHandle = new TSessionHandle(); tSessionHandle.setSessionId(getHandleIdentifier().toTHandleIdentifier()); return tSessionHandle; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((handleId == null) ? 0 : handleId.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Handle)) { return false; } Handle other = (Handle) obj; if (handleId == null) { if (other.handleId != null) { return false; } } else if (!handleId.equals(other.handleId)) { return false; } return true; }
/** * Inits the persist info. * @param sessionConf the session conf */ private void initPersistInfo(Map<String, String> sessionConf) { persistInfo.setSessionHandle(new LensSessionHandle(getSessionHandle().getHandleIdentifier().getPublicId(), getSessionHandle().getHandleIdentifier().getSecretId())); persistInfo.setUsername(getUserName()); persistInfo.setPassword(getPassword()); persistInfo.setLastAccessTime(System.currentTimeMillis()); persistInfo.setSessionConf(sessionConf); persistInfo.setProxyUser(sessionConf.get(LensConfConstants.SESSION_PROXY_USER)); if (sessionConf != null) { for (Map.Entry<String, String> entry : sessionConf.entrySet()) { conf.set(entry.getKey(), entry.getValue()); } } }
public TOperationHandle toTOperationHandle() { TOperationHandle tOperationHandle = new TOperationHandle(); tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); tOperationHandle.setOperationType(opType.toTOperationType()); tOperationHandle.setHasResultSet(hasResultSet); return tOperationHandle; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((handleId == null) ? 0 : handleId.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Handle)) { return false; } Handle other = (Handle) obj; if (handleId == null) { if (other.handleId != null) { return false; } } else if (!handleId.equals(other.handleId)) { return false; } return true; }
throw new LensException(e); LensSessionHandle lensSessionHandle = new LensSessionHandle(sessionHandle.getHandleIdentifier().getPublicId(), sessionHandle.getHandleIdentifier().getSecretId()); SESSION_MAP.put(lensSessionHandle.getPublicId().toString(), lensSessionHandle); updateSessionsPerUser(username);
@Override public void setOperationLogSessionDir(File operationLogRootDir) { if (!operationLogRootDir.exists()) { LOG.warn("The operation log root directory is removed, recreating:" + operationLogRootDir.getAbsolutePath()); if (!operationLogRootDir.mkdirs()) { LOG.warn("Unable to create operation log root directory: " + operationLogRootDir.getAbsolutePath()); } } if (!operationLogRootDir.canWrite()) { LOG.warn("The operation log root directory is not writable: " + operationLogRootDir.getAbsolutePath()); } sessionLogDir = new File(operationLogRootDir, sessionHandle.getHandleIdentifier().toString()); isOperationLogEnabled = true; if (!sessionLogDir.exists()) { if (!sessionLogDir.mkdir()) { LOG.warn("Unable to create operation log session directory: " + sessionLogDir.getAbsolutePath()); isOperationLogEnabled = false; } } if (isOperationLogEnabled) { LOG.info("Operation log session directory is created: " + sessionLogDir.getAbsolutePath()); } }
.toTHandleIdentifier().getGuid()).trim(); driver.setOperationId(guid64);
public Handle() { handleId = new HandleIdentifier(); }
public UUID getSessionId() { return getHandleIdentifier().getPublicId(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((handleId == null) ? 0 : handleId.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Handle)) { return false; } Handle other = (Handle) obj; if (handleId == null) { if (other.handleId != null) { return false; } } else if (!handleId.equals(other.handleId)) { return false; } return true; }
private void addOperation(Operation operation) { LOG.info("Adding operation: {} {}", operation.getHandle(), operation.getParentSession().getSessionHandle()); queryIdOperation.put(getQueryId(operation), operation); handleToOperation.put(operation.getHandle(), operation); if (operation instanceof SQLOperation) { synchronized (webuiLock) { liveQueryInfos.put(operation.getHandle().getHandleIdentifier().toString(), ((SQLOperation) operation).getQueryInfo()); } } }
public TSessionHandle toTSessionHandle() { TSessionHandle tSessionHandle = new TSessionHandle(); tSessionHandle.setSessionId(getHandleIdentifier().toTHandleIdentifier()); return tSessionHandle; }