Search in sources :

Example 1 with CellStub

use of org.dcache.cells.CellStub in project dcache by dCache.

the class LineBasedDoorFactory method doStart.

@Override
protected void doStart() {
    executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat(parentCellName + "-io-%d").build());
    poolManagerHandler = new PoolManagerHandlerSubscriber();
    poolManagerHandler.setPoolManager(new CellStub(parentEndpoint, poolManager, poolManagerTimeout, poolManagerTimeoutUnit));
    poolManagerHandler.start();
    poolManagerHandler.afterStart();
    notifyStarted();
}
Also used : PoolManagerHandlerSubscriber(org.dcache.poolmanager.PoolManagerHandlerSubscriber) CellStub(org.dcache.cells.CellStub) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder)

Example 2 with CellStub

use of org.dcache.cells.CellStub in project dcache by dCache.

the class NettyLineBasedDoorFactory method doStart.

@Override
protected void doStart() {
    executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat(parentCellName + "-%d").build());
    CellStub spaceManager = new CellStub(parentEndpoint, spaceManagerPath, 30_000);
    spaceDescriptionCache = ReservationCaches.buildOwnerDescriptionLookupCache(spaceManager, executor);
    spaceLookupCache = ReservationCaches.buildSpaceLookupCache(spaceManager, executor);
    LoginStrategy loginStrategy = new RemoteLoginStrategy(new CellStub(parentEndpoint, gPlazma, 30_000));
    idResolverFactory = new IdentityResolverFactory(loginStrategy);
    poolManagerHandler = new PoolManagerHandlerSubscriber();
    poolManagerHandler.setPoolManager(new CellStub(parentEndpoint, poolManager, poolManagerTimeout, poolManagerTimeoutUnit));
    poolManagerHandler.start();
    poolManagerHandler.afterStart();
    socketGroup = new NioEventLoopGroup(0, new CDCThreadFactory(new ThreadFactoryBuilder().setNameFormat(parentCellName + "-io-%d").build()));
    notifyStarted();
}
Also used : RemoteLoginStrategy(org.dcache.services.login.RemoteLoginStrategy) IdentityResolverFactory(org.dcache.services.login.IdentityResolverFactory) PoolManagerHandlerSubscriber(org.dcache.poolmanager.PoolManagerHandlerSubscriber) CellStub(org.dcache.cells.CellStub) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) CDCThreadFactory(org.dcache.util.CDCThreadFactory) LoginStrategy(org.dcache.auth.LoginStrategy) RemoteLoginStrategy(org.dcache.services.login.RemoteLoginStrategy) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Example 3 with CellStub

use of org.dcache.cells.CellStub in project dcache by dCache.

the class PnfsManagerV3 method init.

public void init() {
    _stub = new CellStub(getCellEndpoint());
    _fifos = new BlockingQueue[_threads];
    LOGGER.info("Starting {} threads", _fifos.length);
    for (int i = 0; i < _fifos.length; i++) {
        if (_queueMaxSize > 0) {
            _fifos[i] = new LinkedBlockingQueue<>(_queueMaxSize);
        } else {
            _fifos[i] = new LinkedBlockingQueue<>();
        }
        executor.execute(new ProcessThread(_fifos[i]));
    }
    /* Start a seperate queue for list operations.  We use a shared queue,
         * as list operations are read only and thus there is no need
         * to serialize the operations.
         */
    _listQueue = new LinkedBlockingQueue<>();
    for (int j = 0; j < _listThreads; j++) {
        ProcessThread t = new ProcessThread(_listQueue);
        _listProcessThreads.add(t);
        executor.execute(t);
    }
}
Also used : CellStub(org.dcache.cells.CellStub)

Example 4 with CellStub

use of org.dcache.cells.CellStub in project dcache by dCache.

the class PoolStatisticsV0 method starting.

@Override
protected void starting() throws Exception {
    Args args = getArgs();
    if (args.argc() < 1) {
        throw new IllegalArgumentException("Usage : ... <baseDirectory> " + "[-htmlBase=<htmlBase>|none] [-create] [-images=<images>]");
    }
    _poolManager = new CellStub(this, new CellPath(args.getOption("poolManager")), TimeUnit.MILLISECONDS.convert(args.getLongOption("poolManagerTimeout"), TimeUnit.valueOf(args.getOption("poolManagerTimeoutUnit"))));
    _billing = new CellStub(this, new CellPath(args.getOption("billing")), TimeUnit.MILLISECONDS.convert(args.getLongOption("billingTimeout"), TimeUnit.valueOf(args.getOption("billingTimeoutUnit"))));
    _poolStub = new CellStub(this, null, TimeUnit.MILLISECONDS.convert(args.getLongOption("poolTimeout"), TimeUnit.valueOf(args.getOption("poolTimeoutUnit"))));
    _htmlBase = _dbBase = new File(args.argv(0));
    String tmp = args.getOpt("htmlBase");
    if ((tmp != null) && (!tmp.isEmpty())) {
        if (tmp.equals("none")) {
            _createHtmlTree = false;
        } else {
            _htmlBase = new File(tmp);
        }
    }
    tmp = args.getOpt("domain");
    if (tmp != null) {
        _domainName = tmp;
    }
    if (args.hasOption("create")) {
        if (!_dbBase.exists()) {
            // noinspection ResultOfMethodCallIgnored
            _dbBase.mkdirs();
        }
        if (_createHtmlTree && !_htmlBase.exists()) {
            // noinspection ResultOfMethodCallIgnored
            _htmlBase.mkdirs();
        }
    } else {
        if ((!_dbBase.exists()) || (_createHtmlTree && !_htmlBase.exists())) {
            throw new IllegalArgumentException("Either <baseDirectory> or <htmlBase> doesn't exist");
        }
    }
}
Also used : CellPath(dmg.cells.nucleus.CellPath) Args(org.dcache.util.Args) CellStub(org.dcache.cells.CellStub) File(java.io.File)

Example 5 with CellStub

use of org.dcache.cells.CellStub in project dcache by dCache.

the class UserAdminShell method setCellEndpoint.

public void setCellEndpoint(CellEndpoint endpoint) {
    _cellEndpoint = endpoint;
    _cellStub = new CellStub(_cellEndpoint);
}
Also used : CellStub(org.dcache.cells.CellStub)

Aggregations

CellStub (org.dcache.cells.CellStub)12 CellPath (dmg.cells.nucleus.CellPath)4 PoolManagerHandlerSubscriber (org.dcache.poolmanager.PoolManagerHandlerSubscriber)3 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)2 RemoteLoginStrategy (org.dcache.services.login.RemoteLoginStrategy)2 Before (org.junit.Before)2 PnfsHandler (diskCacheV111.util.PnfsHandler)1 CellEndpoint (dmg.cells.nucleus.CellEndpoint)1 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)1 File (java.io.File)1 Serializable (java.io.Serializable)1 Executor (java.util.concurrent.Executor)1 StandardListenerManager (org.apache.curator.framework.listen.StandardListenerManager)1 PathChildrenCache (org.apache.curator.framework.recipes.cache.PathChildrenCache)1 CachingLoginStrategy (org.dcache.auth.CachingLoginStrategy)1 LoginStrategy (org.dcache.auth.LoginStrategy)1 UnionLoginStrategy (org.dcache.auth.UnionLoginStrategy)1 IdentityResolverFactory (org.dcache.services.login.IdentityResolverFactory)1 Args (org.dcache.util.Args)1 CDCThreadFactory (org.dcache.util.CDCThreadFactory)1