public class SparkSessionManagerImpl extends Object implements SparkSessionManager
Modifier and Type | Method and Description |
---|---|
void |
closeSession(SparkSession sparkSession)
Close the given session and return it to pool.
|
static SparkSessionManagerImpl |
getInstance() |
SparkSession |
getSession(SparkSession existingSession,
HiveConf conf,
boolean doOpen)
If the existingSession can be reused return it.
|
void |
returnSession(SparkSession sparkSession)
Return the given sparkSession to pool.
|
void |
setup(HiveConf hiveConf)
Initialize based on given configuration.
|
void |
shutdown()
Shutdown the session manager.
|
public static SparkSessionManagerImpl getInstance() throws HiveException
HiveException
public void setup(HiveConf hiveConf) throws HiveException
SparkSessionManager
setup
in interface SparkSessionManager
HiveException
public SparkSession getSession(SparkSession existingSession, HiveConf conf, boolean doOpen) throws HiveException
getSession
in interface SparkSessionManager
existingSession
- Existing session (can be null)doOpen
- Should the session be opened before returning?HiveException
public void returnSession(SparkSession sparkSession) throws HiveException
SparkSessionManager
returnSession
in interface SparkSessionManager
HiveException
public void closeSession(SparkSession sparkSession) throws HiveException
SparkSessionManager
closeSession
in interface SparkSessionManager
HiveException
public void shutdown()
SparkSessionManager
shutdown
in interface SparkSessionManager
Copyright © 2017 The Apache Software Foundation. All rights reserved.