use of cbit.vcell.simdata.Cachetable in project vcell by virtualcell.
the class SimulationServiceImpl method getDataSetController.
private static DataSetControllerImpl getDataSetController(SimulationServiceContext simServiceContext) {
try {
OutputContext outputContext = new OutputContext(new AnnotatedFunction[0]);
Cachetable cacheTable = new Cachetable(10000);
DataSetControllerImpl datasetController = new DataSetControllerImpl(cacheTable, simServiceContext.localSimDataDir.getParentFile(), null);
simServiceContext.times = datasetController.getDataSetTimes(simServiceContext.vcDataIdentifier);
simServiceContext.dataIdentifiers = datasetController.getDataIdentifiers(outputContext, simServiceContext.vcDataIdentifier);
return datasetController;
} catch (IOException | DataAccessException e1) {
e1.printStackTrace();
throw new RuntimeException("failed to read dataset: " + e1.getMessage());
}
}
use of cbit.vcell.simdata.Cachetable in project vcell by virtualcell.
the class LocalVCellConnectionFactory method createVCellConnection.
/**
* This method was created in VisualAge.
* @return cbit.vcell.server.VCellConnection
*/
public VCellConnection createVCellConnection() throws AuthenticationException, ConnectionException {
try {
if (connectionFactory == null) {
connectionFactory = DatabaseService.getInstance().createConnectionFactory();
}
KeyFactory keyFactory = connectionFactory.getKeyFactory();
LocalVCellConnection.setDatabaseResources(connectionFactory, keyFactory);
AdminDBTopLevel adminDbTopLevel = new AdminDBTopLevel(connectionFactory);
boolean bEnableRetry = false;
boolean isLocal = true;
User user = adminDbTopLevel.getUser(userLoginInfo.getUserName(), userLoginInfo.getDigestedPassword(), bEnableRetry, isLocal);
if (user != null) {
userLoginInfo.setUser(user);
} else {
throw new AuthenticationException("failed to authenticate as user " + userLoginInfo.getUserName());
}
DatabaseServerImpl databaseServerImpl = new DatabaseServerImpl(connectionFactory, keyFactory);
boolean bCache = false;
Cachetable cacheTable = null;
DataSetControllerImpl dataSetControllerImpl = new DataSetControllerImpl(cacheTable, new File(PropertyLoader.getRequiredProperty(PropertyLoader.primarySimDataDirInternalProperty)), new File(PropertyLoader.getRequiredProperty(PropertyLoader.secondarySimDataDirInternalProperty)));
SimulationDatabaseDirect simulationDatabase = new SimulationDatabaseDirect(adminDbTopLevel, databaseServerImpl, bCache);
ExportServiceImpl exportServiceImpl = new ExportServiceImpl();
LocalVCellConnection vcConn = new LocalVCellConnection(userLoginInfo, simulationDatabase, dataSetControllerImpl, exportServiceImpl);
linkHDFLib();
return vcConn;
} catch (Throwable exc) {
lg.error(exc.getMessage(), exc);
throw new ConnectionException(exc.getMessage());
}
}
Aggregations