/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridGgfsPathControlRequest.class, this, "cmd", command()); } }
case OPEN_APPEND: case OPEN_CREATE: { GridGgfsPathControlRequest req = new GridGgfsPathControlRequest(); req.path(readPath(in)); req.destinationPath(readPath(in)); req.flag(in.readBoolean()); req.colocate(in.readBoolean()); req.properties(U.readStringMap(in)); req.start(in.readLong()); req.length(in.readLong()); req.replication(in.readInt()); req.blockSize(in.readLong()); req.accessTime(in.readLong()); req.modificationTime(in.readLong()); else if (cmd == OPEN_READ && req.flag()) req.sequentialReadsBeforePrefetch(in.readInt());
/** * @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; }
case OPEN_APPEND: case OPEN_CREATE: { GridGgfsPathControlRequest req = new GridGgfsPathControlRequest(); req.path(readPath(in)); req.destinationPath(readPath(in)); req.flag(in.readBoolean()); req.colocate(in.readBoolean()); req.properties(U.readStringMap(in)); req.start(in.readLong()); req.length(in.readLong()); req.replication(in.readInt()); req.blockSize(in.readLong()); req.accessTime(in.readLong()); req.modificationTime(in.readLong()); else if (cmd == OPEN_READ && req.flag()) req.sequentialReadsBeforePrefetch(in.readInt());
/** * @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; }
writePath(out, req.path()); writePath(out, req.destinationPath()); out.writeBoolean(req.flag()); out.writeBoolean(req.colocate()); U.writeStringMap(out, req.properties()); out.writeLong(req.start()); out.writeLong(req.length()); out.writeInt(req.replication()); out.writeLong(req.blockSize()); out.writeLong(req.accessTime()); out.writeLong(req.modificationTime()); else if (msg.command() == OPEN_READ && req.flag()) out.writeInt(req.sequentialReadsBeforePrefetch());
/** {@inheritDoc} */ @Override public String toString() { return S.toString(GridGgfsPathControlRequest.class, this, "cmd", command()); } }
writePath(out, req.path()); writePath(out, req.destinationPath()); out.writeBoolean(req.flag()); out.writeBoolean(req.colocate()); U.writeStringMap(out, req.properties()); out.writeLong(req.start()); out.writeLong(req.length()); out.writeInt(req.replication()); out.writeLong(req.blockSize()); out.writeLong(req.accessTime()); out.writeLong(req.modificationTime()); else if (msg.command() == OPEN_READ && req.flag()) out.writeInt(req.sequentialReadsBeforePrefetch());
res.response(ggfs.exists(req.path())); res.response(ggfs.info(req.path())); res.response(ggfs.summary(req.path())); res.response(ggfs.update(req.path(), req.properties())); ggfs.rename(req.path(), req.destinationPath()); res.response(ggfs.delete(req.path(), req.flag())); ggfs.mkdirs(req.path(), req.properties()); res.paths(ggfs.listPaths(req.path())); res.files(ggfs.listFiles(req.path())); ggfs.setTimes(req.path(), req.accessTime(), req.modificationTime()); res.locations(ggfs.affinity(req.path(), req.start(), req.length())); GridGgfsInputStreamAdapter ggfsIn = !req.flag() ? ggfs.open(req.path(), bufSize) : ggfs.open(req.path(), bufSize, req.sequentialReadsBeforePrefetch()); req.path() + ", streamId=" + streamId + ", ses=" + ses + ']'); req.path(), // Path.
res.response(ggfs.exists(req.path())); res.response(ggfs.info(req.path())); res.response(ggfs.summary(req.path())); res.response(ggfs.update(req.path(), req.properties())); ggfs.rename(req.path(), req.destinationPath()); res.response(ggfs.delete(req.path(), req.flag())); ggfs.mkdirs(req.path(), req.properties()); res.paths(ggfs.listPaths(req.path())); res.files(ggfs.listFiles(req.path())); ggfs.setTimes(req.path(), req.accessTime(), req.modificationTime()); res.locations(ggfs.affinity(req.path(), req.start(), req.length())); GridGgfsInputStreamAdapter ggfsIn = !req.flag() ? ggfs.open(req.path(), bufSize) : ggfs.open(req.path(), bufSize, req.sequentialReadsBeforePrefetch()); req.path() + ", streamId=" + streamId + ", ses=" + ses + ']'); req.path(), // Path.