/** * @param req Path control request. * @return Affinity key that maps on local node by the time this method is called if replication factor * is {@code 0}, {@code null} otherwise. */ @Nullable private GridUuid affinityKey(GridGgfsPathControlRequest req) { // Do not generate affinity key for replicated or near-only cache. if (!req.colocate()) { if (log.isDebugEnabled()) log.debug("Will not generate affinity key for path control request [ggfsName=" + ggfs.name() + ", req=" + req + ']'); return null; } GridUuid key = ggfs.nextAffinityKey(); if (log.isDebugEnabled()) log.debug("Generated affinity key for path control request [ggfsName=" + ggfs.name() + ", req=" + req + ", key=" + key + ']'); return key; }
/** * @param req Path control request. * @return Affinity key that maps on local node by the time this method is called if replication factor * is {@code 0}, {@code null} otherwise. */ @Nullable private GridUuid affinityKey(GridGgfsPathControlRequest req) { // Do not generate affinity key for replicated or near-only cache. if (!req.colocate()) { if (log.isDebugEnabled()) log.debug("Will not generate affinity key for path control request [ggfsName=" + ggfs.name() + ", req=" + req + ']'); return null; } GridUuid key = ggfs.nextAffinityKey(); if (log.isDebugEnabled()) log.debug("Generated affinity key for path control request [ggfsName=" + ggfs.name() + ", req=" + req + ", key=" + key + ']'); return key; }
/** * Constructor. * * @param ggfsCtx GGFS context. */ GridGgfsDeleteWorker(GridGgfsContext ggfsCtx) { super("ggfs-delete-worker%" + ggfsCtx.ggfs().name() + "%" + ggfsCtx.kernalContext().localNodeId() + "%"); this.ggfsCtx = ggfsCtx; meta = ggfsCtx.meta(); data = ggfsCtx.data(); evts = ggfsCtx.kernalContext().event(); String ggfsName = ggfsCtx.ggfs().name(); topic = F.isEmpty(ggfsName) ? TOPIC_GGFS : TOPIC_GGFS.topic(ggfsName); assert meta != null; assert data != null; log = ggfsCtx.kernalContext().log(GridGgfsDeleteWorker.class); }
/** * Constructor. * * @param ggfsCtx GGFS context. */ GridGgfsDeleteWorker(GridGgfsContext ggfsCtx) { super("ggfs-delete-worker%" + ggfsCtx.ggfs().name() + "%" + ggfsCtx.kernalContext().localNodeId() + "%"); assert ggfsCtx != null; this.ggfsCtx = ggfsCtx; meta = ggfsCtx.meta(); data = ggfsCtx.data(); evts = ggfsCtx.kernalContext().event(); String ggfsName = ggfsCtx.ggfs().name(); topic = F.isEmpty(ggfsName) ? TOPIC_GGFS : TOPIC_GGFS.topic(ggfsName); assert meta != null; assert data != null; log = ggfsCtx.kernalContext().log(GridGgfsDeleteWorker.class); }
/** * Processes handshake request. * * @param req Handshake request. * @return Response message. * @throws GridException In case of handshake failure. */ private GridGgfsMessage processHandshakeRequest(GridGgfsHandshakeRequest req) throws GridException { if (!F.eq(ctx.gridName(), req.gridName())) throw new GridException("Failed to perform handshake because actual Grid name differs from expected " + "[expected=" + req.gridName() + ", actual=" + ctx.gridName() + ']'); if (!F.eq(ggfs.name(), req.ggfsName())) throw new GridException("Failed to perform handshake because actual GGFS name differs from expected " + "[expected=" + req.ggfsName() + ", actual=" + ggfs.name() + ']'); GridGgfsControlResponse res = new GridGgfsControlResponse(); ggfs.clientLogDirectory(req.logDirectory()); GridGgfsHandshakeResponse handshake = new GridGgfsHandshakeResponse(ggfs.name(), ggfs.proxyPaths(), ggfs.groupBlockSize(), ggfs.globalSampling()); res.handshake(handshake); return res; }
/** * Processes handshake request. * * @param req Handshake request. * @return Response message. * @throws GridException In case of handshake failure. */ private GridGgfsMessage processHandshakeRequest(GridGgfsHandshakeRequest req) throws GridException { if (!F.eq(ctx.gridName(), req.gridName())) throw new GridException("Failed to perform handshake because actual Grid name differs from expected " + "[expected=" + req.gridName() + ", actual=" + ctx.gridName() + ']'); if (!F.eq(ggfs.name(), req.ggfsName())) throw new GridException("Failed to perform handshake because actual GGFS name differs from expected " + "[expected=" + req.ggfsName() + ", actual=" + ggfs.name() + ']'); GridGgfsControlResponse res = new GridGgfsControlResponse(); ggfs.clientLogDirectory(req.logDirectory()); GridGgfsHandshakeResponse handshake = new GridGgfsHandshakeResponse(ggfs.name(), ggfs.proxyPaths(), ggfs.groupBlockSize(), ggfs.globalSampling()); res.handshake(handshake); return res; }
log.debug("Requested to close resource [ggfsName=" + ggfs.name() + ", rsrcId=" + rsrcId + ", res=" + res + ']'); assert success : "Failed to unregister resource [ggfsName=" + ggfs.name() + ", rsrcId=" + rsrcId + ", res=" + res + ']'; log.debug("Closed GGFS stream [ggfsName=" + ggfs.name() + ", streamId=" + rsrcId + ", ses=" + ses + ']');
log.debug("Requested to close resource [ggfsName=" + ggfs.name() + ", rsrcId=" + rsrcId + ", res=" + res + ']'); assert success : "Failed to unregister resource [ggfsName=" + ggfs.name() + ", rsrcId=" + rsrcId + ", res=" + res + ']'; log.debug("Closed GGFS stream [ggfsName=" + ggfs.name() + ", streamId=" + rsrcId + ", ses=" + ses + ']');
log.debug("Processing path control request [ggfsName=" + ggfs.name() + ", req=" + req + ']'); log.debug("Opened GGFS input stream for file read [ggfsName=" + ggfs.name() + ", path=" + req.path() + ", streamId=" + streamId + ", ses=" + ses + ']'); log.debug("Opened GGFS output stream for file create [ggfsName=" + ggfs.name() + ", path=" + req.path() + ", streamId=" + streamId + ", ses=" + ses + ']'); log.debug("Opened GGFS output stream for file append [ggfsName=" + ggfs.name() + ", path=" + req.path() + ", streamId=" + streamId + ", ses=" + ses + ']'); log.debug("Finished processing path control request [ggfsName=" + ggfs.name() + ", req=" + req + ", res=" + res + ']');
log.debug("Processing path control request [ggfsName=" + ggfs.name() + ", req=" + req + ']'); log.debug("Opened GGFS input stream for file read [ggfsName=" + ggfs.name() + ", path=" + req.path() + ", streamId=" + streamId + ", ses=" + ses + ']'); log.debug("Opened GGFS output stream for file create [ggfsName=" + ggfs.name() + ", path=" + req.path() + ", streamId=" + streamId + ", ses=" + ses + ']'); log.debug("Opened GGFS output stream for file append [ggfsName=" + ggfs.name() + ", path=" + req.path() + ", streamId=" + streamId + ", ses=" + ses + ']'); log.debug("Finished processing path control request [ggfsName=" + ggfs.name() + ", req=" + req + ", res=" + res + ']');