You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2014/12/05 09:44:39 UTC
[12/38] incubator-ignite git commit: # Renaming
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java
index 625ad1a..e4230f5 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java
@@ -47,26 +47,26 @@ public class GridGgfsAsyncImpl extends IgniteAsyncSupportAdapter implements Grid
/** {@inheritDoc} */
@Override public <T, R> R execute(GridGgfsTask<T, R> task, @Nullable GridGgfsRecordResolver rslvr,
- Collection<GridGgfsPath> paths, @Nullable T arg) throws GridException {
+ Collection<IgniteFsPath> paths, @Nullable T arg) throws GridException {
return saveOrGet(ggfs.executeAsync(task, rslvr, paths, arg));
}
/** {@inheritDoc} */
@Override public <T, R> R execute(GridGgfsTask<T, R> task, @Nullable GridGgfsRecordResolver rslvr,
- Collection<GridGgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg)
+ Collection<IgniteFsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg)
throws GridException {
return saveOrGet(ggfs.executeAsync(task, rslvr, paths, skipNonExistentFiles, maxRangeLen, arg));
}
/** {@inheritDoc} */
@Override public <T, R> R execute(Class<? extends GridGgfsTask<T, R>> taskCls,
- @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, @Nullable T arg) throws GridException {
+ @Nullable GridGgfsRecordResolver rslvr, Collection<IgniteFsPath> paths, @Nullable T arg) throws GridException {
return saveOrGet(ggfs.executeAsync(taskCls, rslvr, paths, arg));
}
/** {@inheritDoc} */
@Override public <T, R> R execute(Class<? extends GridGgfsTask<T, R>> taskCls,
- @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, boolean skipNonExistentFiles,
+ @Nullable GridGgfsRecordResolver rslvr, Collection<IgniteFsPath> paths, boolean skipNonExistentFiles,
long maxRangeLen, @Nullable T arg) throws GridException {
return saveOrGet(ggfs.executeAsync(taskCls, rslvr, paths, skipNonExistentFiles, maxRangeLen, arg));
}
@@ -87,18 +87,18 @@ public class GridGgfsAsyncImpl extends IgniteAsyncSupportAdapter implements Grid
}
/** {@inheritDoc} */
- @Override public GridGgfsInputStreamAdapter open(GridGgfsPath path, int bufSize,
+ @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize,
int seqReadsBeforePrefetch) throws GridException {
return ggfs.open(path, bufSize, seqReadsBeforePrefetch);
}
/** {@inheritDoc} */
- @Override public GridGgfsInputStreamAdapter open(GridGgfsPath path) throws GridException {
+ @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path) throws GridException {
return ggfs.open(path);
}
/** {@inheritDoc} */
- @Override public GridGgfsInputStreamAdapter open(GridGgfsPath path, int bufSize) throws GridException {
+ @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize) throws GridException {
return ggfs.open(path, bufSize);
}
@@ -143,7 +143,7 @@ public class GridGgfsAsyncImpl extends IgniteAsyncSupportAdapter implements Grid
}
/** {@inheritDoc} */
- @Override public boolean evictExclude(GridGgfsPath path, boolean primary) {
+ @Override public boolean evictExclude(IgniteFsPath path, boolean primary) {
return ggfs.evictExclude(path, primary);
}
@@ -168,52 +168,52 @@ public class GridGgfsAsyncImpl extends IgniteAsyncSupportAdapter implements Grid
}
/** {@inheritDoc} */
- @Override public GridGgfsPathSummary summary(GridGgfsPath path) throws GridException {
+ @Override public IgniteFsPathSummary summary(IgniteFsPath path) throws GridException {
return ggfs.summary(path);
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream create(GridGgfsPath path, boolean overwrite) throws GridException {
+ @Override public GridGgfsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException {
return ggfs.create(path, overwrite);
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream create(GridGgfsPath path, int bufSize, boolean overwrite, int replication,
+ @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication,
long blockSize, @Nullable Map<String, String> props) throws GridException {
return ggfs.create(path, bufSize, overwrite, replication, blockSize, props);
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream create(GridGgfsPath path, int bufSize, boolean overwrite,
+ @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite,
@Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map<String, String> props)
throws GridException {
return ggfs.create(path, bufSize, overwrite, affKey, replication, blockSize, props);
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream append(GridGgfsPath path, boolean create) throws GridException {
+ @Override public GridGgfsOutputStream append(IgniteFsPath path, boolean create) throws GridException {
return ggfs.append(path, create);
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream append(GridGgfsPath path, int bufSize, boolean create,
+ @Override public GridGgfsOutputStream append(IgniteFsPath path, int bufSize, boolean create,
@Nullable Map<String, String> props) throws GridException {
return ggfs.append(path, bufSize, create, props);
}
/** {@inheritDoc} */
- @Override public void setTimes(GridGgfsPath path, long accessTime, long modificationTime) throws GridException {
+ @Override public void setTimes(IgniteFsPath path, long accessTime, long modificationTime) throws GridException {
ggfs.setTimes(path, accessTime, modificationTime);
}
/** {@inheritDoc} */
- @Override public Collection<GridGgfsBlockLocation> affinity(GridGgfsPath path, long start, long len)
+ @Override public Collection<IgniteFsBlockLocation> affinity(IgniteFsPath path, long start, long len)
throws GridException {
return ggfs.affinity(path, start, len);
}
/** {@inheritDoc} */
- @Override public Collection<GridGgfsBlockLocation> affinity(GridGgfsPath path, long start, long len, long maxLen)
+ @Override public Collection<IgniteFsBlockLocation> affinity(IgniteFsPath path, long start, long len, long maxLen)
throws GridException {
return ggfs.affinity(path, start, len, maxLen);
}
@@ -229,52 +229,52 @@ public class GridGgfsAsyncImpl extends IgniteAsyncSupportAdapter implements Grid
}
/** {@inheritDoc} */
- @Override public long size(GridGgfsPath path) throws GridException {
+ @Override public long size(IgniteFsPath path) throws GridException {
return ggfs.size(path);
}
/** {@inheritDoc} */
- @Override public boolean exists(GridGgfsPath path) throws GridException {
+ @Override public boolean exists(IgniteFsPath path) throws GridException {
return ggfs.exists(path);
}
/** {@inheritDoc} */
- @Nullable @Override public GridGgfsFile update(GridGgfsPath path, Map<String, String> props) throws GridException {
+ @Nullable @Override public GridGgfsFile update(IgniteFsPath path, Map<String, String> props) throws GridException {
return ggfs.update(path, props);
}
/** {@inheritDoc} */
- @Override public void rename(GridGgfsPath src, GridGgfsPath dest) throws GridException {
+ @Override public void rename(IgniteFsPath src, IgniteFsPath dest) throws GridException {
ggfs.rename(src, dest);
}
/** {@inheritDoc} */
- @Override public boolean delete(GridGgfsPath path, boolean recursive) throws GridException {
+ @Override public boolean delete(IgniteFsPath path, boolean recursive) throws GridException {
return ggfs.delete(path, recursive);
}
/** {@inheritDoc} */
- @Override public void mkdirs(GridGgfsPath path) throws GridException {
+ @Override public void mkdirs(IgniteFsPath path) throws GridException {
ggfs.mkdirs(path);
}
/** {@inheritDoc} */
- @Override public void mkdirs(GridGgfsPath path, @Nullable Map<String, String> props) throws GridException {
+ @Override public void mkdirs(IgniteFsPath path, @Nullable Map<String, String> props) throws GridException {
ggfs.mkdirs(path, props);
}
/** {@inheritDoc} */
- @Override public Collection<GridGgfsPath> listPaths(GridGgfsPath path) throws GridException {
+ @Override public Collection<IgniteFsPath> listPaths(IgniteFsPath path) throws GridException {
return ggfs.listPaths(path);
}
/** {@inheritDoc} */
- @Override public Collection<GridGgfsFile> listFiles(GridGgfsPath path) throws GridException {
+ @Override public Collection<GridGgfsFile> listFiles(IgniteFsPath path) throws GridException {
return ggfs.listFiles(path);
}
/** {@inheritDoc} */
- @Nullable @Override public GridGgfsFile info(GridGgfsPath path) throws GridException {
+ @Nullable @Override public GridGgfsFile info(IgniteFsPath path) throws GridException {
return ggfs.info(path);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockLocationImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockLocationImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockLocationImpl.java
index 18becde..b94e262 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockLocationImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockLocationImpl.java
@@ -23,7 +23,7 @@ import java.util.*;
/**
* File block location in the grid.
*/
-public class GridGgfsBlockLocationImpl implements GridGgfsBlockLocation, Externalizable {
+public class GridGgfsBlockLocationImpl implements IgniteFsBlockLocation, Externalizable {
/** */
private static final long serialVersionUID = 0L;
@@ -54,7 +54,7 @@ public class GridGgfsBlockLocationImpl implements GridGgfsBlockLocation, Externa
* @param location HDFS block location.
* @param len New length.
*/
- public GridGgfsBlockLocationImpl(GridGgfsBlockLocation location, long len) {
+ public GridGgfsBlockLocationImpl(IgniteFsBlockLocation location, long len) {
assert location != null;
start = location.start();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java
index c1e2c7e..1e1ff41 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java
@@ -370,8 +370,8 @@ public class GridGgfsDataManager extends GridGgfsManager {
* @return Requested data block or {@code null} if nothing found.
* @throws GridException If failed.
*/
- @Nullable public IgniteFuture<byte[]> dataBlock(final GridGgfsFileInfo fileInfo, final GridGgfsPath path,
- final long blockIdx, @Nullable final GridGgfsReader secReader)
+ @Nullable public IgniteFuture<byte[]> dataBlock(final GridGgfsFileInfo fileInfo, final IgniteFsPath path,
+ final long blockIdx, @Nullable final IgniteFsReader secReader)
throws GridException {
//assert validTxState(any); // Allow this method call for any transaction state.
@@ -729,7 +729,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
* @return Affinity blocks locations.
* @throws GridException If failed.
*/
- public Collection<GridGgfsBlockLocation> affinity(GridGgfsFileInfo info, long start, long len)
+ public Collection<IgniteFsBlockLocation> affinity(GridGgfsFileInfo info, long start, long len)
throws GridException {
return affinity(info, start, len, 0);
}
@@ -744,7 +744,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
* @return Affinity blocks locations.
* @throws GridException If failed.
*/
- public Collection<GridGgfsBlockLocation> affinity(GridGgfsFileInfo info, long start, long len, long maxLen)
+ public Collection<IgniteFsBlockLocation> affinity(GridGgfsFileInfo info, long start, long len, long maxLen)
throws GridException {
assert validTxState(false);
assert info.isFile() : "Failed to get affinity (not a file): " + info;
@@ -770,7 +770,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
// In case when affinity key is not null the whole file resides on one node.
if (info.affinityKey() != null) {
- Collection<GridGgfsBlockLocation> res = new LinkedList<>();
+ Collection<IgniteFsBlockLocation> res = new LinkedList<>();
splitBlocks(start, len, maxLen, dataCache.affinity().mapKeyToPrimaryAndBackups(
new GridGgfsBlockKey(info.id(), info.affinityKey(), info.evictExclude(), 0)), res);
@@ -779,7 +779,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
}
// Need to merge ranges affinity with non-colocated affinity.
- Deque<GridGgfsBlockLocation> res = new LinkedList<>();
+ Deque<IgniteFsBlockLocation> res = new LinkedList<>();
if (info.fileMap().ranges().isEmpty()) {
affinity0(info, start, len, maxLen, res);
@@ -803,7 +803,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
pos = partEnd;
}
- GridGgfsBlockLocation last = res.peekLast();
+ IgniteFsBlockLocation last = res.peekLast();
if (range.belongs(pos)) {
long partEnd = Math.min(range.endOffset() + 1, end);
@@ -854,7 +854,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
* @param res Result collection to add regions to.
* @throws GridException If failed.
*/
- private void affinity0(GridGgfsFileInfo info, long start, long len, long maxLen, Deque<GridGgfsBlockLocation> res)
+ private void affinity0(GridGgfsFileInfo info, long start, long len, long maxLen, Deque<IgniteFsBlockLocation> res)
throws GridException {
long firstGrpIdx = start / grpBlockSize;
long limitGrpIdx = (start + len + grpBlockSize - 1) / grpBlockSize;
@@ -897,7 +897,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
log.debug("Mapped key to nodes [key=" + key + ", nodes=" + F.nodeIds(affNodes) +
", blockStart=" + blockStart + ", blockLen=" + blockLen + ']');
- GridGgfsBlockLocation last = res.peekLast();
+ IgniteFsBlockLocation last = res.peekLast();
// Merge with previous affinity block location?
if (last != null && equal(last.nodeIds(), F.viewReadOnly(affNodes, F.node2id()))) {
@@ -926,7 +926,7 @@ public class GridGgfsDataManager extends GridGgfsManager {
* @param res Where to put results.
*/
private void splitBlocks(long start, long len, long maxLen,
- Collection<ClusterNode> nodes, Collection<GridGgfsBlockLocation> res) {
+ Collection<ClusterNode> nodes, Collection<IgniteFsBlockLocation> res) {
if (maxLen > 0) {
long end = start + len;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java
index eaf25ba..0738bbc 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java
@@ -39,14 +39,14 @@ public interface GridGgfsEx extends IgniteFs {
public GridGgfsPaths proxyPaths();
/** {@inheritDoc} */
- @Override GridGgfsInputStreamAdapter open(GridGgfsPath path, int bufSize, int seqReadsBeforePrefetch)
+ @Override GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize, int seqReadsBeforePrefetch)
throws GridException;
/** {@inheritDoc} */
- @Override GridGgfsInputStreamAdapter open(GridGgfsPath path) throws GridException;
+ @Override GridGgfsInputStreamAdapter open(IgniteFsPath path) throws GridException;
/** {@inheritDoc} */
- @Override GridGgfsInputStreamAdapter open(GridGgfsPath path, int bufSize) throws GridException;
+ @Override GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize) throws GridException;
/**
* Gets global space counters.
@@ -116,7 +116,7 @@ public interface GridGgfsEx extends IgniteFs {
* @param primary Whether the mode is PRIMARY.
* @return {@code True} if path is excluded from evictions.
*/
- public boolean evictExclude(GridGgfsPath path, boolean primary);
+ public boolean evictExclude(IgniteFsPath path, boolean primary);
/**
* Get next affinity key.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileImpl.java
index f6f18a1..0485761 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileImpl.java
@@ -25,7 +25,7 @@ public final class GridGgfsFileImpl implements GridGgfsFile, Externalizable {
private static final long serialVersionUID = 0L;
/** Path to this file. */
- private GridGgfsPath path;
+ private IgniteFsPath path;
/** File id. */
private IgniteUuid fileId;
@@ -60,7 +60,7 @@ public final class GridGgfsFileImpl implements GridGgfsFile, Externalizable {
*
* @param path Path.
*/
- public GridGgfsFileImpl(GridGgfsPath path, GridGgfsFileInfo info, long globalGrpBlockSize) {
+ public GridGgfsFileImpl(IgniteFsPath path, GridGgfsFileInfo info, long globalGrpBlockSize) {
A.notNull(path, "path");
A.notNull(info, "info");
@@ -90,7 +90,7 @@ public final class GridGgfsFileImpl implements GridGgfsFile, Externalizable {
* @param path Path.
* @param entry Listing entry.
*/
- public GridGgfsFileImpl(GridGgfsPath path, GridGgfsListingEntry entry, long globalGrpSize) {
+ public GridGgfsFileImpl(IgniteFsPath path, GridGgfsListingEntry entry, long globalGrpSize) {
A.notNull(path, "path");
A.notNull(entry, "entry");
@@ -110,7 +110,7 @@ public final class GridGgfsFileImpl implements GridGgfsFile, Externalizable {
}
/** {@inheritDoc} */
- @Override public GridGgfsPath path() {
+ @Override public IgniteFsPath path() {
return path;
}
@@ -200,7 +200,7 @@ public final class GridGgfsFileImpl implements GridGgfsFile, Externalizable {
* @param in Data input.
*/
@Override public void readExternal(ObjectInput in) throws IOException {
- path = new GridGgfsPath();
+ path = new IgniteFsPath();
path.readExternal(in);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileInfo.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileInfo.java
index da4e6ec..5078088 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileInfo.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileInfo.java
@@ -71,7 +71,7 @@ public final class GridGgfsFileInfo implements Externalizable {
* Original file path. This is a helper field used only in some
* operations like delete.
*/
- private GridGgfsPath path;
+ private IgniteFsPath path;
/**
* {@link Externalizable} support.
@@ -459,7 +459,7 @@ public final class GridGgfsFileInfo implements Externalizable {
/**
* @return Original file path. This is a helper field used only in some operations like delete.
*/
- public GridGgfsPath path() {
+ public IgniteFsPath path() {
return path;
}
@@ -492,7 +492,7 @@ public final class GridGgfsFileInfo implements Externalizable {
accessTime = in.readLong();
modificationTime = in.readLong();
evictExclude = in.readBoolean();
- path = (GridGgfsPath)in.readObject();
+ path = (IgniteFsPath)in.readObject();
}
/** {@inheritDoc} */
@@ -541,7 +541,7 @@ public final class GridGgfsFileInfo implements Externalizable {
* @param path A new path value.
* @return This builder instance (for chaining).
*/
- public Builder path(GridGgfsPath path) {
+ public Builder path(IgniteFsPath path) {
info.path = path;
return this;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java
index 1c3d19c..0d5b7d4 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java
@@ -35,7 +35,7 @@ public class GridGgfsFileWorkerBatch {
private final BlockingDeque<GridGgfsFileWorkerTask> queue = new LinkedBlockingDeque<>();
/** Path to the file in the primary file system. */
- private final GridGgfsPath path;
+ private final IgniteFsPath path;
/** Output stream to the file. */
private final OutputStream out;
@@ -52,7 +52,7 @@ public class GridGgfsFileWorkerBatch {
* @param path Path to the file in the primary file system.
* @param out Output stream opened to that file.
*/
- GridGgfsFileWorkerBatch(GridGgfsPath path, OutputStream out) {
+ GridGgfsFileWorkerBatch(IgniteFsPath path, OutputStream out) {
assert path != null;
assert out != null;
@@ -182,7 +182,7 @@ public class GridGgfsFileWorkerBatch {
*
* @return Primary file system path.
*/
- GridGgfsPath path() {
+ IgniteFsPath path() {
return path;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java
index a07539b..fca2fdb 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java
@@ -87,7 +87,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
private final GridSpinBusyLock busyLock = new GridSpinBusyLock();
/** Writers map. */
- private final ConcurrentHashMap8<GridGgfsPath, GridGgfsFileWorker> workerMap = new ConcurrentHashMap8<>();
+ private final ConcurrentHashMap8<IgniteFsPath, GridGgfsFileWorker> workerMap = new ConcurrentHashMap8<>();
/** Delete futures. */
private final ConcurrentHashMap8<IgniteUuid, GridFutureAdapter<Object>> delFuts = new ConcurrentHashMap8<>();
@@ -163,7 +163,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
}
- ArrayList<T2<GridGgfsPath, GridGgfsMode>> modes = null;
+ ArrayList<T2<IgniteFsPath, GridGgfsMode>> modes = null;
if (!cfgModes.isEmpty()) {
modes = new ArrayList<>(cfgModes.size());
@@ -172,7 +172,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
GridGgfsMode mode0 = secondaryFs == null ? mode.getValue() == PROXY ? PROXY : PRIMARY : mode.getValue();
try {
- modes.add(new T2<>(new GridGgfsPath(mode.getKey()), mode0));
+ modes.add(new T2<>(new IgniteFsPath(mode.getKey()), mode0));
}
catch (IllegalArgumentException e) {
throw new GridException("Invalid path found in mode pattern: " + mode.getKey(), e);
@@ -256,7 +256,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @return Created batch.
* @throws GridException In case new batch cannot be created.
*/
- private GridGgfsFileWorkerBatch newBatch(final GridGgfsPath path, OutputStream out) throws GridException {
+ private GridGgfsFileWorkerBatch newBatch(final IgniteFsPath path, OutputStream out) throws GridException {
assert path != null;
assert out != null;
@@ -319,15 +319,15 @@ public final class GridGgfsImpl implements GridGgfsEx {
*
* @param paths Paths to check.
*/
- void await(GridGgfsPath... paths) {
+ void await(IgniteFsPath... paths) {
assert paths != null;
- for (Map.Entry<GridGgfsPath, GridGgfsFileWorker> workerEntry : workerMap.entrySet()) {
- GridGgfsPath workerPath = workerEntry.getKey();
+ for (Map.Entry<IgniteFsPath, GridGgfsFileWorker> workerEntry : workerMap.entrySet()) {
+ IgniteFsPath workerPath = workerEntry.getKey();
boolean await = false;
- for (GridGgfsPath path : paths) {
+ for (IgniteFsPath path : paths) {
if (workerPath.isSubDirectoryOf(path) || workerPath.isSame(path)) {
await = true;
@@ -461,7 +461,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public boolean exists(GridGgfsPath path) throws GridException {
+ @Override public boolean exists(IgniteFsPath path) throws GridException {
A.notNull(path, "path");
if (log.isDebugEnabled())
@@ -497,7 +497,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public GridGgfsFile info(GridGgfsPath path) throws GridException {
+ @Override public GridGgfsFile info(IgniteFsPath path) throws GridException {
if (enterBusy()) {
try {
A.notNull(path, "path");
@@ -526,7 +526,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public GridGgfsPathSummary summary(GridGgfsPath path) throws GridException {
+ @Override public IgniteFsPathSummary summary(IgniteFsPath path) throws GridException {
if (enterBusy()) {
try {
A.notNull(path, "path");
@@ -539,7 +539,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
if (fileId == null)
throw new GridGgfsFileNotFoundException("Failed to get path summary (path not found): " + path);
- GridGgfsPathSummary sum = new GridGgfsPathSummary(path);
+ IgniteFsPathSummary sum = new IgniteFsPathSummary(path);
summary0(fileId, sum);
@@ -554,7 +554,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public GridGgfsFile update(GridGgfsPath path, Map<String, String> props) throws GridException {
+ @Override public GridGgfsFile update(IgniteFsPath path, Map<String, String> props) throws GridException {
if (enterBusy()) {
try {
A.notNull(path, "path");
@@ -610,7 +610,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public void rename(GridGgfsPath src, GridGgfsPath dest) throws GridException {
+ @Override public void rename(IgniteFsPath src, IgniteFsPath dest) throws GridException {
if (enterBusy()) {
try {
A.notNull(src, "src");
@@ -651,7 +651,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
return;
}
- GridGgfsPath destParent = dest.parent();
+ IgniteFsPath destParent = dest.parent();
// Resolve source file info.
FileDescriptor srcDesc = getFileDescriptor(src);
@@ -701,7 +701,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
if (evts.isRecordable(EVT_GGFS_FILE_RENAMED))
evts.record(new IgniteFsEvent(
src,
- newDest ? dest : new GridGgfsPath(dest, destFileName),
+ newDest ? dest : new IgniteFsPath(dest, destFileName),
localNode(),
EVT_GGFS_FILE_RENAMED));
}
@@ -719,7 +719,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public boolean delete(GridGgfsPath path, boolean recursive) throws GridException {
+ @Override public boolean delete(IgniteFsPath path, boolean recursive) throws GridException {
if (enterBusy()) {
try {
A.notNull(path, "path");
@@ -783,9 +783,9 @@ public final class GridGgfsImpl implements GridGgfsEx {
* {@code recursive} flag is false, will return {@code false}.
* @throws GridException In case of error.
*/
- private boolean delete0(FileDescriptor desc, @Nullable GridGgfsPath parentPath, boolean recursive)
+ private boolean delete0(FileDescriptor desc, @Nullable IgniteFsPath parentPath, boolean recursive)
throws GridException {
- GridGgfsPath curPath = parentPath == null ? new GridGgfsPath() : new GridGgfsPath(parentPath, desc.fileName);
+ IgniteFsPath curPath = parentPath == null ? new IgniteFsPath() : new IgniteFsPath(parentPath, desc.fileName);
if (desc.isFile) {
deleteFile(curPath, desc, true);
@@ -815,12 +815,12 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public void mkdirs(GridGgfsPath path) throws GridException {
+ @Override public void mkdirs(IgniteFsPath path) throws GridException {
mkdirs(path, null);
}
/** {@inheritDoc} */
- @Override public void mkdirs(GridGgfsPath path, @Nullable Map<String, String> props) throws GridException {
+ @Override public void mkdirs(IgniteFsPath path, @Nullable Map<String, String> props) throws GridException {
if (enterBusy()) {
try {
A.notNull(path, "path");
@@ -853,7 +853,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
IgniteUuid parentId = ROOT_ID;
- GridGgfsPath curPath = path.root();
+ IgniteFsPath curPath = path.root();
for (int step = 0, size = components.size(); step < size; step++) {
IgniteUuid fileId = ids.get(step + 1); // Skip the first ROOT element.
@@ -863,7 +863,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
String fileName = components.get(step); // Get current component name.
- curPath = new GridGgfsPath(curPath, fileName);
+ curPath = new IgniteFsPath(curPath, fileName);
try {
// Fails only if parent is not a directory or if modified concurrently.
@@ -907,7 +907,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public Collection<GridGgfsPath> listPaths(final GridGgfsPath path) throws GridException {
+ @Override public Collection<IgniteFsPath> listPaths(final IgniteFsPath path) throws GridException {
if (enterBusy()) {
try {
A.notNull(path, "path");
@@ -927,9 +927,9 @@ public final class GridGgfsImpl implements GridGgfsEx {
if (childrenModes.contains(DUAL_SYNC) || childrenModes.contains(DUAL_ASYNC)) {
assert secondaryFs != null;
- Collection<GridGgfsPath> children = secondaryFs.listPaths(path);
+ Collection<IgniteFsPath> children = secondaryFs.listPaths(path);
- for (GridGgfsPath child : children)
+ for (IgniteFsPath child : children)
files.add(child.name());
}
@@ -943,10 +943,10 @@ public final class GridGgfsImpl implements GridGgfsEx {
throw new GridGgfsFileNotFoundException("Failed to list files (path not found): " + path);
}
- return F.viewReadOnly(files, new C1<String, GridGgfsPath>() {
+ return F.viewReadOnly(files, new C1<String, IgniteFsPath>() {
@Override
- public GridGgfsPath apply(String e) {
- return new GridGgfsPath(path, e);
+ public IgniteFsPath apply(String e) {
+ return new IgniteFsPath(path, e);
}
});
}
@@ -959,7 +959,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public Collection<GridGgfsFile> listFiles(final GridGgfsPath path) throws GridException {
+ @Override public Collection<GridGgfsFile> listFiles(final IgniteFsPath path) throws GridException {
if (enterBusy()) {
try {
A.notNull(path, "path");
@@ -1003,7 +1003,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
// Perform the listing.
for (Map.Entry<String, GridGgfsListingEntry> e : info.listing().entrySet()) {
- GridGgfsPath p = new GridGgfsPath(path, e.getKey());
+ IgniteFsPath p = new IgniteFsPath(path, e.getKey());
files.add(new GridGgfsFileImpl(p, e.getValue(), data.groupBlockSize()));
}
@@ -1036,17 +1036,17 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public GridGgfsInputStreamAdapter open(GridGgfsPath path) throws GridException {
+ @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path) throws GridException {
return open(path, cfg.getStreamBufferSize(), cfg.getSequentialReadsBeforePrefetch());
}
/** {@inheritDoc} */
- @Override public GridGgfsInputStreamAdapter open(GridGgfsPath path, int bufSize) throws GridException {
+ @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize) throws GridException {
return open(path, bufSize, cfg.getSequentialReadsBeforePrefetch());
}
/** {@inheritDoc} */
- @Override public GridGgfsInputStreamAdapter open(GridGgfsPath path, int bufSize, int seqReadsBeforePrefetch)
+ @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize, int seqReadsBeforePrefetch)
throws GridException {
if (enterBusy()) {
try {
@@ -1107,18 +1107,18 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream create(GridGgfsPath path, boolean overwrite) throws GridException {
+ @Override public GridGgfsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException {
return create0(path, cfg.getStreamBufferSize(), overwrite, null, 0, null, true);
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream create(GridGgfsPath path, int bufSize, boolean overwrite, int replication,
+ @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication,
long blockSize, @Nullable Map<String, String> props) throws GridException {
return create0(path, bufSize, overwrite, null, replication, props, false);
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream create(GridGgfsPath path, int bufSize, boolean overwrite,
+ @Override public GridGgfsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite,
@Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map<String, String> props)
throws GridException {
return create0(path, bufSize, overwrite, affKey, replication, props, false);
@@ -1138,7 +1138,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @throws GridException If file creation failed.
*/
private GridGgfsOutputStream create0(
- final GridGgfsPath path,
+ final IgniteFsPath path,
final int bufSize,
final boolean overwrite,
@Nullable IgniteUuid affKey,
@@ -1181,7 +1181,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
// Re-create parents when working in PRIMARY mode. In DUAL mode this is done by MetaManager.
- GridGgfsPath parent = path.parent();
+ IgniteFsPath parent = path.parent();
// Create missing parent directories if necessary.
if (parent != null)
@@ -1209,13 +1209,13 @@ public final class GridGgfsImpl implements GridGgfsEx {
break;
if (!overwrite)
- throw new GridGgfsPathAlreadyExistsException("Failed to create file (file already exists): " +
+ throw new IgniteFsPathAlreadyExistsException("Failed to create file (file already exists): " +
path);
GridGgfsFileInfo oldInfo = meta.info(oldId);
if (oldInfo.isDirectory())
- throw new GridGgfsPathAlreadyExistsException("Failed to create file (path points to a " +
+ throw new IgniteFsPathAlreadyExistsException("Failed to create file (path points to a " +
"directory): " + path);
// Remove old file from the tree.
@@ -1248,12 +1248,12 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream append(GridGgfsPath path, boolean create) throws GridException {
+ @Override public GridGgfsOutputStream append(IgniteFsPath path, boolean create) throws GridException {
return append(path, cfg.getStreamBufferSize(), create, null);
}
/** {@inheritDoc} */
- @Override public GridGgfsOutputStream append(final GridGgfsPath path, final int bufSize, boolean create,
+ @Override public GridGgfsOutputStream append(final IgniteFsPath path, final int bufSize, boolean create,
@Nullable Map<String, String> props) throws GridException {
if (enterBusy()) {
try {
@@ -1332,7 +1332,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public void setTimes(GridGgfsPath path, long accessTime, long modificationTime)
+ @Override public void setTimes(IgniteFsPath path, long accessTime, long modificationTime)
throws GridException {
if (enterBusy()) {
try {
@@ -1369,7 +1369,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @param path Path to check.
* @throws GridException If path exists.
*/
- private void checkConflictWithPrimary(GridGgfsPath path) throws GridException {
+ private void checkConflictWithPrimary(IgniteFsPath path) throws GridException {
if (secondaryFs != null) {
if (secondaryFs.info(path) != null) {
throw new GridException("Path mapped to a PRIMARY mode found in secondary file " +
@@ -1379,13 +1379,13 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public Collection<GridGgfsBlockLocation> affinity(GridGgfsPath path, long start, long len)
+ @Override public Collection<IgniteFsBlockLocation> affinity(IgniteFsPath path, long start, long len)
throws GridException {
return affinity(path, start, len, 0L);
}
/** {@inheritDoc} */
- @Override public Collection<GridGgfsBlockLocation> affinity(GridGgfsPath path, long start, long len, long maxLen)
+ @Override public Collection<IgniteFsBlockLocation> affinity(IgniteFsPath path, long start, long len, long maxLen)
throws GridException {
if (enterBusy()) {
try {
@@ -1434,7 +1434,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
@Override public GridGgfsMetrics metrics() throws GridException {
if (enterBusy()) {
try {
- GridGgfsPathSummary sum = new GridGgfsPathSummary();
+ IgniteFsPathSummary sum = new IgniteFsPathSummary();
summary0(ROOT_ID, sum);
@@ -1482,7 +1482,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public long size(GridGgfsPath path) throws GridException {
+ @Override public long size(IgniteFsPath path) throws GridException {
if (enterBusy()) {
try {
A.notNull(path, "path");
@@ -1492,7 +1492,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
if (nextId == null)
return 0;
- GridGgfsPathSummary sum = new GridGgfsPathSummary(path);
+ IgniteFsPathSummary sum = new IgniteFsPathSummary(path);
summary0(nextId, sum);
@@ -1513,7 +1513,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @param sum Summary object that will collect information.
* @throws GridException If failed.
*/
- private void summary0(IgniteUuid fileId, GridGgfsPathSummary sum) throws GridException {
+ private void summary0(IgniteUuid fileId, IgniteFsPathSummary sum) throws GridException {
assert sum != null;
GridGgfsFileInfo info = meta.info(fileId);
@@ -1611,7 +1611,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @return Detailed file descriptor or {@code null}, if file does not exist.
* @throws GridException If failed.
*/
- @Nullable private FileDescriptor getFileDescriptor(GridGgfsPath path) throws GridException {
+ @Nullable private FileDescriptor getFileDescriptor(IgniteFsPath path) throws GridException {
List<IgniteUuid> ids = meta.fileIds(path);
GridGgfsFileInfo fileInfo = meta.info(ids.get(ids.size() - 1));
@@ -1632,7 +1632,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @param rmvLocked Whether to remove this entry in case it is has explicit lock.
* @throws GridException If failed.
*/
- private void deleteFile(GridGgfsPath path, FileDescriptor desc, boolean rmvLocked) throws GridException {
+ private void deleteFile(IgniteFsPath path, FileDescriptor desc, boolean rmvLocked) throws GridException {
IgniteUuid parentId = desc.parentId;
IgniteUuid fileId = desc.fileId;
@@ -1668,26 +1668,26 @@ public final class GridGgfsImpl implements GridGgfsEx {
/** {@inheritDoc} */
@Override public <T, R> R execute(GridGgfsTask<T, R> task, @Nullable GridGgfsRecordResolver rslvr,
- Collection<GridGgfsPath> paths, @Nullable T arg) throws GridException {
+ Collection<IgniteFsPath> paths, @Nullable T arg) throws GridException {
return executeAsync(task, rslvr, paths, arg).get();
}
/** {@inheritDoc} */
@Override public <T, R> R execute(GridGgfsTask<T, R> task, @Nullable GridGgfsRecordResolver rslvr,
- Collection<GridGgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg)
+ Collection<IgniteFsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg)
throws GridException {
return executeAsync(task, rslvr, paths, skipNonExistentFiles, maxRangeLen, arg).get();
}
/** {@inheritDoc} */
@Override public <T, R> R execute(Class<? extends GridGgfsTask<T, R>> taskCls,
- @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, @Nullable T arg) throws GridException {
+ @Nullable GridGgfsRecordResolver rslvr, Collection<IgniteFsPath> paths, @Nullable T arg) throws GridException {
return executeAsync(taskCls, rslvr, paths, arg).get();
}
/** {@inheritDoc} */
@Override public <T, R> R execute(Class<? extends GridGgfsTask<T, R>> taskCls,
- @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, boolean skipNonExistentFiles,
+ @Nullable GridGgfsRecordResolver rslvr, Collection<IgniteFsPath> paths, boolean skipNonExistentFiles,
long maxRangeSize, @Nullable T arg) throws GridException {
return executeAsync(taskCls, rslvr, paths, skipNonExistentFiles, maxRangeSize, arg).get();
}
@@ -1702,7 +1702,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @return Execution future.
*/
<T, R> IgniteFuture<R> executeAsync(GridGgfsTask<T, R> task, @Nullable GridGgfsRecordResolver rslvr,
- Collection<GridGgfsPath> paths, @Nullable T arg) {
+ Collection<IgniteFsPath> paths, @Nullable T arg) {
return executeAsync(task, rslvr, paths, true, cfg.getMaximumTaskRangeLength(), arg);
}
@@ -1721,7 +1721,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @return Execution future.
*/
<T, R> IgniteFuture<R> executeAsync(GridGgfsTask<T, R> task, @Nullable GridGgfsRecordResolver rslvr,
- Collection<GridGgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) {
+ Collection<IgniteFsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) {
return ggfsCtx.kernalContext().task().execute(task, new GridGgfsTaskArgsImpl<>(cfg.getName(), paths, rslvr,
skipNonExistentFiles, maxRangeLen, arg));
}
@@ -1736,7 +1736,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @return Execution future.
*/
<T, R> IgniteFuture<R> executeAsync(Class<? extends GridGgfsTask<T, R>> taskCls,
- @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, @Nullable T arg) {
+ @Nullable GridGgfsRecordResolver rslvr, Collection<IgniteFsPath> paths, @Nullable T arg) {
return executeAsync(taskCls, rslvr, paths, true, cfg.getMaximumTaskRangeLength(), arg);
}
@@ -1754,14 +1754,14 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @return Execution future.
*/
<T, R> IgniteFuture<R> executeAsync(Class<? extends GridGgfsTask<T, R>> taskCls,
- @Nullable GridGgfsRecordResolver rslvr, Collection<GridGgfsPath> paths, boolean skipNonExistentFiles,
+ @Nullable GridGgfsRecordResolver rslvr, Collection<IgniteFsPath> paths, boolean skipNonExistentFiles,
long maxRangeLen, @Nullable T arg) {
return ggfsCtx.kernalContext().task().execute((Class<GridGgfsTask<T, R>>)taskCls,
new GridGgfsTaskArgsImpl<>(cfg.getName(), paths, rslvr, skipNonExistentFiles, maxRangeLen, arg));
}
/** {@inheritDoc} */
- @Override public boolean evictExclude(GridGgfsPath path, boolean primary) {
+ @Override public boolean evictExclude(IgniteFsPath path, boolean primary) {
assert path != null;
try {
@@ -1783,7 +1783,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @return File info or {@code null} in case file is not found.
* @throws GridException If failed.
*/
- private GridGgfsFileInfo resolveFileInfo(GridGgfsPath path, GridGgfsMode mode) throws GridException {
+ private GridGgfsFileInfo resolveFileInfo(IgniteFsPath path, GridGgfsMode mode) throws GridException {
assert path != null;
assert mode != null;
@@ -1914,7 +1914,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @param batch Optional secondary file system batch.
* @throws GridException In case of error.
*/
- GgfsEventAwareOutputStream(GridGgfsPath path, GridGgfsFileInfo fileInfo,
+ GgfsEventAwareOutputStream(IgniteFsPath path, GridGgfsFileInfo fileInfo,
IgniteUuid parentId, int bufSize, GridGgfsMode mode, @Nullable GridGgfsFileWorkerBatch batch)
throws GridException {
super(ggfsCtx, path, fileInfo, parentId, bufSize, mode, batch, metrics);
@@ -1954,8 +1954,8 @@ public final class GridGgfsImpl implements GridGgfsEx {
* @param secReader Optional secondary file system reader.
* @param metrics Metrics.
*/
- GgfsEventAwareInputStream(GridGgfsContext ggfsCtx, GridGgfsPath path, GridGgfsFileInfo fileInfo,
- int prefetchBlocks, int seqReadsBeforePrefetch, @Nullable GridGgfsReader secReader,
+ GgfsEventAwareInputStream(GridGgfsContext ggfsCtx, IgniteFsPath path, GridGgfsFileInfo fileInfo,
+ int prefetchBlocks, int seqReadsBeforePrefetch, @Nullable IgniteFsReader secReader,
GridGgfsLocalMetrics metrics) {
super(ggfsCtx, path, fileInfo, prefetchBlocks, seqReadsBeforePrefetch, secReader, metrics);
@@ -2138,7 +2138,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
/** {@inheritDoc} */
@Override public boolean isProxy(URI path) {
GridGgfsMode mode = F.isEmpty(cfg.getPathModes()) ? cfg.getDefaultMode() :
- modeRslvr.resolveMode(new GridGgfsPath(path));
+ modeRslvr.resolveMode(new IgniteFsPath(path));
return mode == PROXY;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java
index 2a0240f..5fa2366 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java
@@ -37,13 +37,13 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter {
/** Secondary file system reader. */
@SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized")
- private final GridGgfsReader secReader;
+ private final IgniteFsReader secReader;
/** Logger. */
private IgniteLogger log;
/** Path to file. */
- protected final GridGgfsPath path;
+ protected final IgniteFsPath path;
/** File descriptor. */
private volatile GridGgfsFileInfo fileInfo;
@@ -101,8 +101,8 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter {
* @param secReader Optional secondary file system reader.
* @param metrics Local GGFS metrics.
*/
- GridGgfsInputStreamImpl(GridGgfsContext ggfsCtx, GridGgfsPath path, GridGgfsFileInfo fileInfo, int prefetchBlocks,
- int seqReadsBeforePrefetch, @Nullable GridGgfsReader secReader, GridGgfsLocalMetrics metrics) {
+ GridGgfsInputStreamImpl(GridGgfsContext ggfsCtx, IgniteFsPath path, GridGgfsFileInfo fileInfo, int prefetchBlocks,
+ int seqReadsBeforePrefetch, @Nullable IgniteFsReader secReader, GridGgfsLocalMetrics metrics) {
assert ggfsCtx != null;
assert path != null;
assert fileInfo != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java
index 246187a..3ef20fe 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java
@@ -33,7 +33,7 @@ public class GridGgfsJobImpl implements ComputeJob, GridInternalWrapper<GridGgfs
private String ggfsName;
/** GGFS path. */
- private GridGgfsPath path;
+ private IgniteFsPath path;
/** Start. */
private long start;
@@ -60,7 +60,7 @@ public class GridGgfsJobImpl implements ComputeJob, GridInternalWrapper<GridGgfs
* @param len Split length.
* @param rslvr GGFS split resolver.
*/
- public GridGgfsJobImpl(GridGgfsJob job, String ggfsName, GridGgfsPath path, long start, long len,
+ public GridGgfsJobImpl(GridGgfsJob job, String ggfsName, IgniteFsPath path, long start, long len,
GridGgfsRecordResolver rslvr) {
this.job = job;
this.ggfsName = ggfsName;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java
index e1b1391..cff85d0 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java
@@ -160,7 +160,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return File ID for specified path or {@code null} if such file doesn't exist.
* @throws GridException If failed.
*/
- @Nullable public IgniteUuid fileId(GridGgfsPath path) throws GridException {
+ @Nullable public IgniteUuid fileId(IgniteFsPath path) throws GridException {
if (busyLock.enterBusy()) {
try {
assert validTxState(false);
@@ -183,7 +183,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return File ID for specified path or {@code null} if such file doesn't exist.
* @throws GridException If failed.
*/
- @Nullable private IgniteUuid fileId(GridGgfsPath path, boolean skipTx) throws GridException {
+ @Nullable private IgniteUuid fileId(IgniteFsPath path, boolean skipTx) throws GridException {
List<IgniteUuid> ids = fileIds(path, skipTx);
assert ids != null && !ids.isEmpty() : "Invalid file IDs [path=" + path + ", ids=" + ids + ']';
@@ -243,7 +243,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Collection of file IDs for components of specified path.
* @throws GridException If failed.
*/
- public List<IgniteUuid> fileIds(GridGgfsPath path) throws GridException {
+ public List<IgniteUuid> fileIds(IgniteFsPath path) throws GridException {
if (busyLock.enterBusy()) {
try {
assert validTxState(false);
@@ -268,7 +268,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Collection of file IDs for components of specified path.
* @throws GridException If failed.
*/
- private List<IgniteUuid> fileIds(GridGgfsPath path, boolean skipTx) throws GridException {
+ private List<IgniteUuid> fileIds(IgniteFsPath path, boolean skipTx) throws GridException {
assert path != null;
// Path components.
@@ -885,7 +885,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @throws GridException If failed.
*/
@Nullable public GridGgfsFileInfo removeIfEmpty(IgniteUuid parentId, String fileName, IgniteUuid fileId,
- GridGgfsPath path, boolean rmvLocked)
+ IgniteFsPath path, boolean rmvLocked)
throws GridException {
if (busyLock.enterBusy()) {
try {
@@ -932,7 +932,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @throws GridException If failed.
*/
@Nullable private GridGgfsFileInfo removeIfEmptyNonTx(@Nullable IgniteUuid parentId, String fileName, IgniteUuid fileId,
- GridGgfsPath path, boolean rmvLocked)
+ IgniteFsPath path, boolean rmvLocked)
throws GridException {
assert validTxState(true);
assert parentId != null;
@@ -1577,7 +1577,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Output stream descriptor.
* @throws GridException If file creation failed.
*/
- public GridGgfsSecondaryOutputStreamDescriptor createDual(final GridGgfsFileSystem fs, final GridGgfsPath path,
+ public GridGgfsSecondaryOutputStreamDescriptor createDual(final GridGgfsFileSystem fs, final IgniteFsPath path,
final boolean simpleCreate, @Nullable final Map<String, String> props, final boolean overwrite, final int bufSize,
final short replication, final long blockSize, final IgniteUuid affKey)
throws GridException {
@@ -1594,14 +1594,14 @@ public class GridGgfsMetaManager extends GridGgfsManager {
/** Output stream to the secondary file system. */
private OutputStream out;
- @Override public GridGgfsSecondaryOutputStreamDescriptor onSuccess(Map<GridGgfsPath,
+ @Override public GridGgfsSecondaryOutputStreamDescriptor onSuccess(Map<IgniteFsPath,
GridGgfsFileInfo> infos) throws Exception {
assert !infos.isEmpty();
// Determine the first existing parent.
- GridGgfsPath parentPath = null;
+ IgniteFsPath parentPath = null;
- for (GridGgfsPath curPath : infos.keySet()) {
+ for (IgniteFsPath curPath : infos.keySet()) {
if (parentPath == null || curPath.isSubDirectoryOf(parentPath))
parentPath = curPath;
}
@@ -1614,7 +1614,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
out = simpleCreate ? fs.create(path, overwrite) :
fs.create(path, bufSize, overwrite, replication, blockSize, props);
- GridGgfsPath parent0 = path.parent();
+ IgniteFsPath parent0 = path.parent();
assert parent0 != null : "path.parent() is null (are we creating ROOT?): " + path;
@@ -1624,7 +1624,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
// Fire notification about missing directories creation.
if (evts.isRecordable(EVT_GGFS_DIR_CREATED)) {
- GridGgfsPath evtPath = parent0;
+ IgniteFsPath evtPath = parent0;
while (!parentPath.equals(evtPath)) {
pendingEvts.addFirst(new IgniteFsEvent(evtPath, locNode, EVT_GGFS_DIR_CREATED));
@@ -1737,7 +1737,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Output stream descriptor.
* @throws GridException If output stream open for append has failed.
*/
- public GridGgfsSecondaryOutputStreamDescriptor appendDual(final GridGgfsFileSystem fs, final GridGgfsPath path,
+ public GridGgfsSecondaryOutputStreamDescriptor appendDual(final GridGgfsFileSystem fs, final IgniteFsPath path,
final int bufSize) throws GridException {
if (busyLock.enterBusy()) {
try {
@@ -1749,7 +1749,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
/** Output stream to the secondary file system. */
private OutputStream out;
- @Override public GridGgfsSecondaryOutputStreamDescriptor onSuccess(Map<GridGgfsPath,
+ @Override public GridGgfsSecondaryOutputStreamDescriptor onSuccess(Map<IgniteFsPath,
GridGgfsFileInfo> infos) throws Exception {
GridGgfsFileInfo info = infos.get(path);
@@ -1768,7 +1768,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
if (remainder > 0) {
int blockIdx = (int)(len / blockSize);
- GridGgfsReader reader = fs.open(path, bufSize);
+ IgniteFsReader reader = fs.open(path, bufSize);
try {
ggfsCtx.data().dataBlock(info, path, blockIdx, reader).get();
@@ -1820,7 +1820,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Input stream descriptor.
* @throws GridException If input stream open has failed.
*/
- public GridGgfsSecondaryInputStreamDescriptor openDual(final GridGgfsFileSystem fs, final GridGgfsPath path,
+ public GridGgfsSecondaryInputStreamDescriptor openDual(final GridGgfsFileSystem fs, final IgniteFsPath path,
final int bufSize)
throws GridException {
if (busyLock.enterBusy()) {
@@ -1842,7 +1842,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
SynchronizationTask<GridGgfsSecondaryInputStreamDescriptor> task =
new SynchronizationTask<GridGgfsSecondaryInputStreamDescriptor>() {
@Override public GridGgfsSecondaryInputStreamDescriptor onSuccess(
- Map<GridGgfsPath, GridGgfsFileInfo> infos) throws Exception {
+ Map<IgniteFsPath, GridGgfsFileInfo> infos) throws Exception {
GridGgfsFileInfo info = infos.get(path);
if (info == null)
@@ -1884,7 +1884,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return File info or {@code null} if file not found.
* @throws GridException If sync task failed.
*/
- @Nullable public GridGgfsFileInfo synchronizeFileDual(final GridGgfsFileSystem fs, final GridGgfsPath path)
+ @Nullable public GridGgfsFileInfo synchronizeFileDual(final GridGgfsFileSystem fs, final IgniteFsPath path)
throws GridException {
assert fs != null;
assert path != null;
@@ -1900,7 +1900,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
// If failed, try synchronize.
SynchronizationTask<GridGgfsFileInfo> task =
new SynchronizationTask<GridGgfsFileInfo>() {
- @Override public GridGgfsFileInfo onSuccess(Map<GridGgfsPath, GridGgfsFileInfo> infos)
+ @Override public GridGgfsFileInfo onSuccess(Map<IgniteFsPath, GridGgfsFileInfo> infos)
throws Exception {
return infos.get(path);
}
@@ -1935,7 +1935,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return {@code True} in case rename was successful.
* @throws GridException If directory creation failed.
*/
- public boolean mkdirsDual(final GridGgfsFileSystem fs, final GridGgfsPath path, final Map<String, String> props)
+ public boolean mkdirsDual(final GridGgfsFileSystem fs, final IgniteFsPath path, final Map<String, String> props)
throws GridException {
if (busyLock.enterBusy()) {
try {
@@ -1950,15 +1950,15 @@ public class GridGgfsMetaManager extends GridGgfsManager {
final Deque<IgniteFsEvent> pendingEvts = new LinkedList<>();
SynchronizationTask<Boolean> task = new SynchronizationTask<Boolean>() {
- @Override public Boolean onSuccess(Map<GridGgfsPath, GridGgfsFileInfo> infos) throws Exception {
+ @Override public Boolean onSuccess(Map<IgniteFsPath, GridGgfsFileInfo> infos) throws Exception {
fs.mkdirs(path, props);
assert !infos.isEmpty();
// Now perform synchronization again starting with the last created parent.
- GridGgfsPath parentPath = null;
+ IgniteFsPath parentPath = null;
- for (GridGgfsPath curPath : infos.keySet()) {
+ for (IgniteFsPath curPath : infos.keySet()) {
if (parentPath == null || curPath.isSubDirectoryOf(parentPath))
parentPath = curPath;
}
@@ -1970,7 +1970,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
synchronize(fs, parentPath, parentPathInfo, path, true, null);
if (evts.isRecordable(EVT_GGFS_DIR_CREATED)) {
- GridGgfsPath evtPath = path;
+ IgniteFsPath evtPath = path;
while (!parentPath.equals(evtPath)) {
pendingEvts.addFirst(new IgniteFsEvent(evtPath, locNode, EVT_GGFS_DIR_CREATED));
@@ -2019,7 +2019,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Operation result.
* @throws GridException If failed.
*/
- public boolean renameDual(final GridGgfsFileSystem fs, final GridGgfsPath src, final GridGgfsPath dest) throws
+ public boolean renameDual(final GridGgfsFileSystem fs, final IgniteFsPath src, final IgniteFsPath dest) throws
GridException {
if (busyLock.enterBusy()) {
try {
@@ -2034,7 +2034,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
final Collection<IgniteFsEvent> pendingEvts = new LinkedList<>();
SynchronizationTask<Boolean> task = new SynchronizationTask<Boolean>() {
- @Override public Boolean onSuccess(Map<GridGgfsPath, GridGgfsFileInfo> infos) throws Exception {
+ @Override public Boolean onSuccess(Map<IgniteFsPath, GridGgfsFileInfo> infos) throws Exception {
GridGgfsFileInfo srcInfo = infos.get(src);
GridGgfsFileInfo srcParentInfo = infos.get(src.parent());
GridGgfsFileInfo destInfo = infos.get(dest);
@@ -2072,7 +2072,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
if (evts.isRecordable(EVT_GGFS_FILE_RENAMED))
pendingEvts.add(new IgniteFsEvent(
src,
- destInfo == null ? dest : new GridGgfsPath(dest, src.name()),
+ destInfo == null ? dest : new IgniteFsPath(dest, src.name()),
locNode,
EVT_GGFS_FILE_RENAMED));
}
@@ -2120,7 +2120,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Operation result.
* @throws GridException If delete failed.
*/
- public boolean deleteDual(final GridGgfsFileSystem fs, final GridGgfsPath path, final boolean recursive)
+ public boolean deleteDual(final GridGgfsFileSystem fs, final IgniteFsPath path, final boolean recursive)
throws GridException {
if (busyLock.enterBusy()) {
try {
@@ -2128,7 +2128,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
assert path != null;
SynchronizationTask<Boolean> task = new SynchronizationTask<Boolean>() {
- @Override public Boolean onSuccess(Map<GridGgfsPath, GridGgfsFileInfo> infos) throws Exception {
+ @Override public Boolean onSuccess(Map<IgniteFsPath, GridGgfsFileInfo> infos) throws Exception {
GridGgfsFileInfo info = infos.get(path);
if (info == null)
@@ -2186,7 +2186,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Update file info.
* @throws GridException If update failed.
*/
- public GridGgfsFileInfo updateDual(final GridGgfsFileSystem fs, final GridGgfsPath path, final Map<String, String> props)
+ public GridGgfsFileInfo updateDual(final GridGgfsFileSystem fs, final IgniteFsPath path, final Map<String, String> props)
throws GridException {
assert fs != null;
assert path != null;
@@ -2195,7 +2195,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
if (busyLock.enterBusy()) {
try {
SynchronizationTask<GridGgfsFileInfo> task = new SynchronizationTask<GridGgfsFileInfo>() {
- @Override public GridGgfsFileInfo onSuccess(Map<GridGgfsPath, GridGgfsFileInfo> infos)
+ @Override public GridGgfsFileInfo onSuccess(Map<IgniteFsPath, GridGgfsFileInfo> infos)
throws Exception {
if (infos.get(path) == null)
return null;
@@ -2239,8 +2239,8 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return File info of the end path.
* @throws GridException If failed.
*/
- private GridGgfsFileInfo synchronize(GridGgfsFileSystem fs, GridGgfsPath startPath, GridGgfsFileInfo startPathInfo,
- GridGgfsPath endPath, boolean strict, @Nullable Map<GridGgfsPath, GridGgfsFileInfo> created)
+ private GridGgfsFileInfo synchronize(GridGgfsFileSystem fs, IgniteFsPath startPath, GridGgfsFileInfo startPathInfo,
+ IgniteFsPath endPath, boolean strict, @Nullable Map<IgniteFsPath, GridGgfsFileInfo> created)
throws GridException {
assert fs != null;
assert startPath != null && startPathInfo != null && endPath != null;
@@ -2251,10 +2251,10 @@ public class GridGgfsMetaManager extends GridGgfsManager {
List<String> components = endPath.components();
- GridGgfsPath curPath = startPath;
+ IgniteFsPath curPath = startPath;
for (int i = startPath.components().size(); i < components.size(); i++) {
- curPath = new GridGgfsPath(curPath, components.get(i));
+ curPath = new IgniteFsPath(curPath, components.get(i));
if (created != null && created.containsKey(curPath))
// Re-use already created info.
@@ -2312,7 +2312,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @throws GridException If failed.
*/
private <T> T synchronizeAndExecute(SynchronizationTask<T> task, GridGgfsFileSystem fs, boolean strict,
- GridGgfsPath... paths)
+ IgniteFsPath... paths)
throws GridException {
return synchronizeAndExecute(task, fs, strict, null, paths);
}
@@ -2330,7 +2330,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @throws GridException If failed.
*/
private <T> T synchronizeAndExecute(SynchronizationTask<T> task, GridGgfsFileSystem fs, boolean strict,
- @Nullable Collection<IgniteUuid> extraLockIds, GridGgfsPath... paths) throws GridException {
+ @Nullable Collection<IgniteUuid> extraLockIds, IgniteFsPath... paths) throws GridException {
assert task != null;
assert fs != null;
assert paths != null && paths.length > 0;
@@ -2347,7 +2347,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
// Obtain existing IDs outside the transaction.
List<List<IgniteUuid>> pathIds = new ArrayList<>(paths.length);
- for (GridGgfsPath path : paths)
+ for (IgniteFsPath path : paths)
pathIds.add(fileIds(path));
// Start pessimistic.
@@ -2355,19 +2355,19 @@ public class GridGgfsMetaManager extends GridGgfsManager {
try {
// Lock the very first existing parents and possibly the leaf as well.
- Map<GridGgfsPath, GridGgfsPath> pathToParent = new HashMap<>();
+ Map<IgniteFsPath, IgniteFsPath> pathToParent = new HashMap<>();
- Map<GridGgfsPath, IgniteUuid> pathToId = new HashMap<>();
+ Map<IgniteFsPath, IgniteUuid> pathToId = new HashMap<>();
for (int i = 0; i < paths.length; i++) {
- GridGgfsPath path = paths[i];
+ IgniteFsPath path = paths[i];
// Determine the very first existing parent
List<IgniteUuid> ids = pathIds.get(i);
if (ids.size() > 1) {
// The path is not root.
- GridGgfsPath parentPath = path.parent();
+ IgniteFsPath parentPath = path.parent();
IgniteUuid parentId = ids.get(ids.size() - 2);
for (int j = ids.size() - 3; j >= 0; j--) {
@@ -2413,9 +2413,9 @@ public class GridGgfsMetaManager extends GridGgfsManager {
}
// Ensure that locked IDs still point to expected paths.
- GridGgfsPath changed = null;
+ IgniteFsPath changed = null;
- for (Map.Entry<GridGgfsPath, IgniteUuid> entry : pathToId.entrySet()) {
+ for (Map.Entry<IgniteFsPath, IgniteUuid> entry : pathToId.entrySet()) {
if (!idToInfo.containsKey(entry.getValue()) ||
!F.eq(entry.getValue(), fileId(entry.getKey(), true))) {
changed = entry.getKey();
@@ -2447,12 +2447,12 @@ public class GridGgfsMetaManager extends GridGgfsManager {
continue; // Release all locks and try again.
else {
// Perform synchronization.
- Map<GridGgfsPath, GridGgfsFileInfo> infos = new HashMap<>();
+ Map<IgniteFsPath, GridGgfsFileInfo> infos = new HashMap<>();
- TreeMap<GridGgfsPath, GridGgfsFileInfo> created = new TreeMap<>();
+ TreeMap<IgniteFsPath, GridGgfsFileInfo> created = new TreeMap<>();
- for (GridGgfsPath path : paths) {
- GridGgfsPath parentPath = path.parent();
+ for (IgniteFsPath path : paths) {
+ IgniteFsPath parentPath = path.parent();
if (pathToId.containsKey(path)) {
infos.put(path, info(pathToId.get(path)));
@@ -2461,7 +2461,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
infos.put(parentPath, info(pathToId.get(parentPath)));
}
else {
- GridGgfsPath firstParentPath = pathToParent.get(path);
+ IgniteFsPath firstParentPath = pathToParent.get(path);
assert firstParentPath != null;
assert pathToId.get(firstParentPath) != null;
@@ -2634,7 +2634,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @return Task result.
* @throws Exception If failed.
*/
- public T onSuccess(Map<GridGgfsPath, GridGgfsFileInfo> infos) throws Exception;
+ public T onSuccess(Map<IgniteFsPath, GridGgfsFileInfo> infos) throws Exception;
/**
* Callback handler in case synchronization failed.
@@ -2651,13 +2651,13 @@ public class GridGgfsMetaManager extends GridGgfsManager {
*/
private static class PathDescriptor {
/** Path. */
- private final GridGgfsPath path;
+ private final IgniteFsPath path;
/** Resolved IDs. */
private final List<IgniteUuid> ids;
/** Parent path. */
- private GridGgfsPath parentPath;
+ private IgniteFsPath parentPath;
/** Parent path info. */
private GridGgfsFileInfo parentInfo;
@@ -2670,7 +2670,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @param parentPath Parent path.
* @param parentInfo Parent info.
*/
- PathDescriptor(GridGgfsPath path, List<IgniteUuid> ids, GridGgfsPath parentPath, GridGgfsFileInfo parentInfo) {
+ PathDescriptor(IgniteFsPath path, List<IgniteUuid> ids, IgniteFsPath parentPath, GridGgfsFileInfo parentInfo) {
assert path != null;
assert ids != null && !ids.isEmpty();
assert parentPath == null && parentInfo == null || parentPath != null && parentInfo != null;
@@ -2707,7 +2707,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
* @param newParentPath New parent path.
* @param newParentInfo New parent info.
*/
- private void updateParent(GridGgfsPath newParentPath, GridGgfsFileInfo newParentInfo) {
+ private void updateParent(IgniteFsPath newParentPath, GridGgfsFileInfo newParentInfo) {
assert newParentPath != null;
assert newParentInfo != null;
assert path.isSubDirectoryOf(newParentPath);
@@ -2723,7 +2723,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
*
* @return Parent path.
*/
- private GridGgfsPath parentPath() {
+ private IgniteFsPath parentPath() {
return parentPath;
}
@@ -2929,12 +2929,12 @@ public class GridGgfsMetaManager extends GridGgfsManager {
private static final long serialVersionUID = 0L;
/** New path. */
- private GridGgfsPath path;
+ private IgniteFsPath path;
/**
* @param path Path.
*/
- private UpdatePath(GridGgfsPath path) {
+ private UpdatePath(IgniteFsPath path) {
this.path = path;
}
@@ -2956,7 +2956,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- path = (GridGgfsPath)in.readObject();
+ path = (IgniteFsPath)in.readObject();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java
index 004a796..022ca75 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModeResolver.java
@@ -27,30 +27,30 @@ public class GridGgfsModeResolver {
private final GridGgfsMode dfltMode;
/** Modes for particular paths. Ordered from longest to shortest. */
- private ArrayList<T2<GridGgfsPath, GridGgfsMode>> modes;
+ private ArrayList<T2<IgniteFsPath, GridGgfsMode>> modes;
/** Cached modes per path. */
- private Map<GridGgfsPath, GridGgfsMode> modesCache;
+ private Map<IgniteFsPath, GridGgfsMode> modesCache;
/** Cached children modes per path. */
- private Map<GridGgfsPath, Set<GridGgfsMode>> childrenModesCache;
+ private Map<IgniteFsPath, Set<GridGgfsMode>> childrenModesCache;
/**
* @param dfltMode Default GGFS mode.
* @param modes List of configured modes.
*/
- public GridGgfsModeResolver(GridGgfsMode dfltMode, @Nullable List<T2<GridGgfsPath, GridGgfsMode>> modes) {
+ public GridGgfsModeResolver(GridGgfsMode dfltMode, @Nullable List<T2<IgniteFsPath, GridGgfsMode>> modes) {
assert dfltMode != null;
this.dfltMode = dfltMode;
if (modes != null) {
- ArrayList<T2<GridGgfsPath, GridGgfsMode>> modes0 = new ArrayList<>(modes);
+ ArrayList<T2<IgniteFsPath, GridGgfsMode>> modes0 = new ArrayList<>(modes);
// Sort paths, longest first.
- Collections.sort(modes0, new Comparator<Map.Entry<GridGgfsPath, GridGgfsMode>>() {
- @Override public int compare(Map.Entry<GridGgfsPath, GridGgfsMode> o1,
- Map.Entry<GridGgfsPath, GridGgfsMode> o2) {
+ Collections.sort(modes0, new Comparator<Map.Entry<IgniteFsPath, GridGgfsMode>>() {
+ @Override public int compare(Map.Entry<IgniteFsPath, GridGgfsMode> o1,
+ Map.Entry<IgniteFsPath, GridGgfsMode> o2) {
return o2.getKey().components().size() - o1.getKey().components().size();
}
});
@@ -68,7 +68,7 @@ public class GridGgfsModeResolver {
* @param path GGFS path.
* @return GGFS mode.
*/
- public GridGgfsMode resolveMode(GridGgfsPath path) {
+ public GridGgfsMode resolveMode(IgniteFsPath path) {
assert path != null;
if (modes == null)
@@ -77,7 +77,7 @@ public class GridGgfsModeResolver {
GridGgfsMode mode = modesCache.get(path);
if (mode == null) {
- for (T2<GridGgfsPath, GridGgfsMode> entry : modes) {
+ for (T2<IgniteFsPath, GridGgfsMode> entry : modes) {
if (startsWith(path, entry.getKey())) {
// As modes ordered from most specific to least specific first mode found is ours.
mode = entry.getValue();
@@ -100,7 +100,7 @@ public class GridGgfsModeResolver {
* @param path Path.
* @return Set of all modes that children paths could have.
*/
- public Set<GridGgfsMode> resolveChildrenModes(GridGgfsPath path) {
+ public Set<GridGgfsMode> resolveChildrenModes(IgniteFsPath path) {
assert path != null;
if (modes == null)
@@ -113,7 +113,7 @@ public class GridGgfsModeResolver {
GridGgfsMode pathDefault = dfltMode;
- for (T2<GridGgfsPath, GridGgfsMode> child : modes) {
+ for (T2<IgniteFsPath, GridGgfsMode> child : modes) {
if (startsWith(path, child.getKey())) {
pathDefault = child.getValue();
@@ -136,7 +136,7 @@ public class GridGgfsModeResolver {
* @return Unmodifiable copy of properly ordered modes prefixes
* or {@code null} if no modes set.
*/
- @Nullable public List<T2<GridGgfsPath, GridGgfsMode>> modesOrdered() {
+ @Nullable public List<T2<IgniteFsPath, GridGgfsMode>> modesOrdered() {
return modes != null ? Collections.unmodifiableList(modes) : null;
}
@@ -147,7 +147,7 @@ public class GridGgfsModeResolver {
* @param prefix Prefix.
* @return {@code true} if path starts with prefix, {@code false} if not.
*/
- private static boolean startsWith(GridGgfsPath path, GridGgfsPath prefix) {
+ private static boolean startsWith(IgniteFsPath path, IgniteFsPath prefix) {
List<String> p1Comps = path.components();
List<String> p2Comps = prefix.components();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java
index 7137d52..40334fc 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamAdapter.java
@@ -23,7 +23,7 @@ import java.nio.*;
@SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
abstract class GridGgfsOutputStreamAdapter extends GridGgfsOutputStream {
/** Path to file. */
- protected final GridGgfsPath path;
+ protected final IgniteFsPath path;
/** Buffer size. */
private final int bufSize;
@@ -47,7 +47,7 @@ abstract class GridGgfsOutputStreamAdapter extends GridGgfsOutputStream {
* @param path Path to stored file.
* @param bufSize The size of the buffer to be used.
*/
- GridGgfsOutputStreamAdapter(GridGgfsPath path, int bufSize) {
+ GridGgfsOutputStreamAdapter(IgniteFsPath path, int bufSize) {
assert path != null;
assert bufSize > 0;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f3d93762/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamImpl.java
index eca6e9b..7e9c001 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsOutputStreamImpl.java
@@ -90,7 +90,7 @@ class GridGgfsOutputStreamImpl extends GridGgfsOutputStreamAdapter {
* @param metrics Local GGFs metrics.
* @throws GridException If stream creation failed.
*/
- GridGgfsOutputStreamImpl(GridGgfsContext ggfsCtx, GridGgfsPath path, GridGgfsFileInfo fileInfo, IgniteUuid parentId,
+ GridGgfsOutputStreamImpl(GridGgfsContext ggfsCtx, IgniteFsPath path, GridGgfsFileInfo fileInfo, IgniteUuid parentId,
int bufSize, GridGgfsMode mode, @Nullable GridGgfsFileWorkerBatch batch, GridGgfsLocalMetrics metrics)
throws GridException {
super(path, optimizeBufferSize(bufSize, fileInfo));