Search in sources :

Example 6 with Cachetable

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());
    }
}
Also used : Cachetable(cbit.vcell.simdata.Cachetable) DataSetControllerImpl(cbit.vcell.simdata.DataSetControllerImpl) IOException(java.io.IOException) OutputContext(cbit.vcell.simdata.OutputContext) ThriftDataAccessException(org.vcell.vcellij.api.ThriftDataAccessException) DataAccessException(org.vcell.util.DataAccessException)

Example 7 with Cachetable

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());
    }
}
Also used : Cachetable(cbit.vcell.simdata.Cachetable) AdminDBTopLevel(cbit.vcell.modeldb.AdminDBTopLevel) User(org.vcell.util.document.User) AuthenticationException(org.vcell.util.AuthenticationException) SimulationDatabaseDirect(cbit.vcell.message.server.dispatcher.SimulationDatabaseDirect) DatabaseServerImpl(cbit.vcell.modeldb.DatabaseServerImpl) DataSetControllerImpl(cbit.vcell.simdata.DataSetControllerImpl) ExportServiceImpl(cbit.vcell.export.server.ExportServiceImpl) File(java.io.File) KeyFactory(org.vcell.db.KeyFactory) ConnectionException(cbit.vcell.server.ConnectionException)

Aggregations

Cachetable (cbit.vcell.simdata.Cachetable)7 DataSetControllerImpl (cbit.vcell.simdata.DataSetControllerImpl)7 File (java.io.File)6 ExportServiceImpl (cbit.vcell.export.server.ExportServiceImpl)3 DataServerImpl (cbit.vcell.simdata.DataServerImpl)3 VCMessagingService (cbit.vcell.message.VCMessagingService)2 ServerMessagingDelegate (cbit.vcell.message.server.ServerMessagingDelegate)2 ServiceInstanceStatus (cbit.vcell.message.server.ServiceInstanceStatus)2 SimulationDatabaseDirect (cbit.vcell.message.server.dispatcher.SimulationDatabaseDirect)2 AdminDBTopLevel (cbit.vcell.modeldb.AdminDBTopLevel)2 DatabaseServerImpl (cbit.vcell.modeldb.DatabaseServerImpl)2 Date (java.util.Date)2 KeyFactory (org.vcell.db.KeyFactory)2 User (org.vcell.util.document.User)2 DisplayPreferences (cbit.image.DisplayPreferences)1 ExportEvent (cbit.rmi.event.ExportEvent)1 VCMessagingException (cbit.vcell.message.VCMessagingException)1 CommandService (cbit.vcell.message.server.cmd.CommandService)1 CommandServiceLocal (cbit.vcell.message.server.cmd.CommandServiceLocal)1 CommandServiceSshNative (cbit.vcell.message.server.cmd.CommandServiceSshNative)1