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:48 UTC
[21/38] incubator-ignite git commit: # Renaming
# Renaming
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1d26f5fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1d26f5fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1d26f5fd
Branch: refs/heads/master
Commit: 1d26f5fdfaa44ff74368515215b47372abc97fb6
Parents: 3ba3dc4
Author: sboikov <sb...@gridgain.com>
Authored: Fri Dec 5 11:21:05 2014 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Dec 5 11:21:05 2014 +0300
----------------------------------------------------------------------
.../org/gridgain/examples/ggfs/GgfsExample.java | 2 +-
.../main/java/org/apache/ignite/IgniteFs.java | 8 +-
.../gridgain/grid/ggfs/GridGgfsInputStream.java | 72 ------
.../GridGgfsInvalidHdfsVersionException.java | 34 ---
.../grid/ggfs/GridGgfsInvalidPathException.java | 49 ----
.../org/gridgain/grid/ggfs/GridGgfsMetrics.java | 151 ------------
.../GridGgfsParentNotDirectoryException.java | 2 +-
.../ggfs/IgniteFsFileNotFoundException.java | 2 +-
.../gridgain/grid/ggfs/IgniteFsInputStream.java | 72 ++++++
.../IgniteFsInvalidHdfsVersionException.java | 34 +++
.../grid/ggfs/IgniteFsInvalidPathException.java | 49 ++++
.../org/gridgain/grid/ggfs/IgniteFsMetrics.java | 151 ++++++++++++
.../IgniteFsPathAlreadyExistsException.java | 2 +-
.../GridGgfsInputStreamJobAdapter.java | 4 +-
.../grid/ggfs/mapreduce/GridGgfsJob.java | 6 +-
.../mapreduce/GridGgfsRangeInputStream.java | 10 +-
.../ggfs/mapreduce/GridGgfsRecordResolver.java | 2 +-
.../GridGgfsByteDelimiterRecordResolver.java | 6 +-
.../GridGgfsFixedLengthRecordResolver.java | 2 +-
.../ggfs/common/GridGgfsControlResponse.java | 4 +-
.../processors/ggfs/GridGgfsAsyncImpl.java | 2 +-
.../kernal/processors/ggfs/GridGgfsImpl.java | 22 +-
.../ggfs/GridGgfsInputStreamAdapter.java | 2 +-
.../ggfs/GridGgfsInputStreamImpl.java | 2 +-
.../kernal/processors/ggfs/GridGgfsJobImpl.java | 2 +-
.../processors/ggfs/GridGgfsMetaManager.java | 16 +-
.../processors/ggfs/GridGgfsMetricsAdapter.java | 231 -------------------
.../processors/ggfs/IgniteFsMetricsAdapter.java | 231 +++++++++++++++++++
.../kernal/visor/ggfs/VisorGgfsMetrics.java | 4 +-
.../ggfs/GridGgfsEventsAbstractSelfTest.java | 2 +-
.../grid/ggfs/GridGgfsFragmentizerSelfTest.java | 6 +-
...heGgfsPerBlockLruEvictionPolicySelfTest.java | 8 +-
.../ggfs/GridGgfsAbstractSelfTest.java | 4 +-
.../ggfs/GridGgfsDualAbstractSelfTest.java | 6 +-
.../ggfs/GridGgfsMetricsSelfTest.java | 16 +-
.../processors/ggfs/GridGgfsModesSelfTest.java | 6 +-
.../ggfs/GridGgfsProcessorSelfTest.java | 6 +-
.../processors/ggfs/GridGgfsSizeSelfTest.java | 2 +-
.../ggfs/GridGgfsStreamsSelfTest.java | 6 +-
.../processors/ggfs/GridGgfsTaskSelfTest.java | 2 +-
.../GridGgfsAbstractRecordResolverSelfTest.java | 2 +-
...GgfsByteDelimiterRecordResolverSelfTest.java | 4 +-
...idGgfsFixedLengthRecordResolverSelfTest.java | 4 +-
...sNewLineDelimiterRecordResolverSelfTest.java | 4 +-
...fsStringDelimiterRecordResolverSelfTest.java | 4 +-
.../hadoop/GridGgfsHadoopFileSystemWrapper.java | 2 +-
...dGgfsHadoop20FileSystemAbstractSelfTest.java | 2 +-
.../GridGgfsHadoopDualAbstractSelfTest.java | 2 +-
...idHadoopDefaultMapReducePlannerSelfTest.java | 2 +-
49 files changed, 632 insertions(+), 632 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/examples/src/main/java/org/gridgain/examples/ggfs/GgfsExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/gridgain/examples/ggfs/GgfsExample.java b/examples/src/main/java/org/gridgain/examples/ggfs/GgfsExample.java
index 8049b75..ecdd947 100644
--- a/examples/src/main/java/org/gridgain/examples/ggfs/GgfsExample.java
+++ b/examples/src/main/java/org/gridgain/examples/ggfs/GgfsExample.java
@@ -220,7 +220,7 @@ public final class GgfsExample {
byte[] data = new byte[(int)fs.info(path).length()];
- try (GridGgfsInputStream in = fs.open(path)) {
+ try (IgniteFsInputStream in = fs.open(path)) {
in.read(data);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/apache/ignite/IgniteFs.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteFs.java b/modules/core/src/main/java/org/apache/ignite/IgniteFs.java
index b2780fc..cf9f9a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteFs.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteFs.java
@@ -88,7 +88,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
* @throws GridException In case of error.
* @throws org.gridgain.grid.ggfs.IgniteFsFileNotFoundException If path doesn't exist.
*/
- public GridGgfsInputStream open(IgniteFsPath path) throws GridException;
+ public IgniteFsInputStream open(IgniteFsPath path) throws GridException;
/**
* Opens a file for reading.
@@ -99,7 +99,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
* @throws GridException In case of error.
* @throws org.gridgain.grid.ggfs.IgniteFsFileNotFoundException If path doesn't exist.
*/
- @Override public GridGgfsInputStream open(IgniteFsPath path, int bufSize) throws GridException;
+ @Override public IgniteFsInputStream open(IgniteFsPath path, int bufSize) throws GridException;
/**
* Opens a file for reading.
@@ -111,7 +111,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
* @throws GridException In case of error.
* @throws org.gridgain.grid.ggfs.IgniteFsFileNotFoundException If path doesn't exist.
*/
- public GridGgfsInputStream open(IgniteFsPath path, int bufSize, int seqReadsBeforePrefetch) throws GridException;
+ public IgniteFsInputStream open(IgniteFsPath path, int bufSize, int seqReadsBeforePrefetch) throws GridException;
/**
* Creates a file and opens it for writing.
@@ -229,7 +229,7 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
* @return Metrics.
* @throws GridException In case of error.
*/
- public GridGgfsMetrics metrics() throws GridException;
+ public IgniteFsMetrics metrics() throws GridException;
/**
* Resets metrics for this file system.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInputStream.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInputStream.java
deleted file mode 100644
index e3f8c0b..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInputStream.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/* @java.file.header */
-
-/* _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
- */
-
-package org.gridgain.grid.ggfs;
-
-import java.io.*;
-
-/**
- * {@code GGFS} input stream to read data from the file system.
- * It provides several additional methods for asynchronous access.
- */
-public abstract class GridGgfsInputStream extends InputStream implements IgniteFsReader {
- /**
- * Gets file length during file open.
- *
- * @return File length.
- */
- public abstract long length();
-
- /**
- * Seek to the specified position.
- *
- * @param pos Position to seek to.
- * @throws IOException In case of IO exception.
- */
- public abstract void seek(long pos) throws IOException;
-
- /**
- * Get the current position in the input stream.
- *
- * @return The current position in the input stream.
- * @throws IOException In case of IO exception.
- */
- public abstract long position() throws IOException;
-
- /**
- * Read bytes from the given position in the stream to the given buffer.
- * Continues to read until passed buffer becomes filled.
- *
- * @param pos Position in the input stream to seek.
- * @param buf Buffer into which data is read.
- * @throws IOException In case of IO exception.
- */
- public abstract void readFully(long pos, byte[] buf) throws IOException;
-
- /**
- *
- * @param pos Position in the input stream to seek.
- * @param buf Buffer into which data is read.
- * @param off Offset in the buffer from which stream data should be written.
- * @param len The number of bytes to read.
- * @throws IOException In case of IO exception.
- */
- public abstract void readFully(long pos, byte[] buf, int off, int len) throws IOException;
-
- /**
- *
- * @param pos Position in the input stream to seek.
- * @param buf Buffer into which data is read.
- * @param off Offset in the buffer from which stream data should be written.
- * @param len The number of bytes to read.
- * @return Total number of bytes read into the buffer, or -1 if there is no more data (EOF).
- * @throws IOException In case of IO exception.
- */
- @Override public abstract int read(long pos, byte[] buf, int off, int len) throws IOException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInvalidHdfsVersionException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInvalidHdfsVersionException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInvalidHdfsVersionException.java
deleted file mode 100644
index 1bb28c2..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInvalidHdfsVersionException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/* @java.file.header */
-
-/* _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
- */
-
-package org.gridgain.grid.ggfs;
-
-/**
- * Exception thrown when GridGain detects that remote HDFS version differs from version of HDFS libraries
- * in GridGain classpath.
- */
-public class GridGgfsInvalidHdfsVersionException extends IgniteFsException {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param msg Error message.
- */
- public GridGgfsInvalidHdfsVersionException(String msg) {
- super(msg);
- }
-
- /**
- * @param msg Error message.
- * @param cause Error cause.
- */
- public GridGgfsInvalidHdfsVersionException(String msg, Throwable cause) {
- super(msg, cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInvalidPathException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInvalidPathException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInvalidPathException.java
deleted file mode 100644
index 76627a8..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsInvalidPathException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* @java.file.header */
-
-/* _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
- */
-
-package org.gridgain.grid.ggfs;
-
-import org.jetbrains.annotations.*;
-
-/**
- * {@code GGFS} exception indicating that operation target is invalid
- * (e.g. not a file while expecting to be a file).
- */
-public class GridGgfsInvalidPathException extends IgniteFsException {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Creates exception with given error message.
- *
- * @param msg Error message.
- */
- public GridGgfsInvalidPathException(String msg) {
- super(msg);
- }
-
- /**
- * Creates exception with given exception cause.
- *
- * @param cause Exception cause.
- */
- public GridGgfsInvalidPathException(Throwable cause) {
- super(cause);
- }
-
- /**
- * Creates exception with given error message and exception cause.
- *
- * @param msg Error message.
- * @param cause Error cause.
- */
- public GridGgfsInvalidPathException(String msg, @Nullable Throwable cause) {
- super(msg, cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsMetrics.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsMetrics.java
deleted file mode 100644
index 31fffea..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsMetrics.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* @java.file.header */
-
-/* _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
- */
-
-package org.gridgain.grid.ggfs;
-
-/**
- * {@code GGFS} metrics snapshot for the file system. Note, that some metrics are global and
- * some are local (i.e. per each node).
- */
-public interface GridGgfsMetrics {
- /**
- * Gets local used space in bytes. This is the sum of all file chunks stored on local node.
- * <p>
- * This is a local metric.
- *
- * @return Node used space in bytes.
- */
- public long localSpaceSize();
-
- /**
- * Gets maximum amount of data that can be stored on local node. This metrics is either
- * equal to {@link IgniteFsConfiguration#getMaxSpaceSize()}, or, if it is {@code 0}, equal to
- * {@code 80%} of maximum heap size allocated for JVM.
- *
- * @return Maximum GGFS local space size.
- */
- public long maxSpaceSize();
-
- /**
- * Get used space in bytes used in the secondary file system.
- * <p>
- * This is a global metric.
- *
- * @return Used space in the secondary file system or {@code 0} in case no secondary file system is configured.
- */
- public long secondarySpaceSize();
-
- /**
- * Gets number of directories created in file system.
- * <p>
- * This is a global metric.
- *
- * @return Number of directories.
- */
- public int directoriesCount();
-
- /**
- * Gets number of files stored in file system.
- * <p>
- * This is a global metric.
- *
- * @return Number of files.
- */
- public int filesCount();
-
- /**
- * Gets number of files that are currently opened for reading.
- * <p>
- * This is a local metric.
- *
- * @return Number of opened files.
- */
- public int filesOpenedForRead();
-
- /**
- * Gets number of files that are currently opened for writing.
- * <p>
- * This is a local metric.
- *
- * @return Number of opened files.
- */
- public int filesOpenedForWrite();
-
- /**
- * Gets total blocks read, local and remote.
- * <p>
- * This is a local metric.
- *
- * @return Total blocks read.
- */
- public long blocksReadTotal();
-
- /**
- * Gets total remote blocks read.
- * <p>
- * This is a local metric.
- *
- * @return Total blocks remote read.
- */
- public long blocksReadRemote();
-
- /**
- * Gets total blocks written, local and remote.
- * <p>
- * This is a local metric.
- *
- * @return Total blocks written.
- */
- public long blocksWrittenTotal();
-
- /**
- * Gets total remote blocks written.
- * <p>
- * This is a local metric.
- *
- * @return Total blocks written.
- */
- public long blocksWrittenRemote();
-
- /**
- * Gets total bytes read.
- * <p>
- * This is a local metric.
- *
- * @return Total bytes read.
- */
- public long bytesRead();
-
- /**
- * Gets total bytes read time.
- * <p>
- * This is a local metric.
- *
- * @return Total bytes read time.
- */
- public long bytesReadTime();
-
- /**
- * Gets total bytes written.
- * <p>
- * This is a local metric.
- *
- * @return Total bytes written.
- */
- public long bytesWritten();
-
- /**
- * Gets total bytes write time.
- * <p>
- * This is a local metric.
- *
- * @return Total bytes write time.
- */
- public long bytesWriteTime();
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java
index b953f38..dc71dd2 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/GridGgfsParentNotDirectoryException.java
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.*;
/**
* Exception thrown when parent supposed to be a directory is a file.
*/
-public class GridGgfsParentNotDirectoryException extends GridGgfsInvalidPathException {
+public class GridGgfsParentNotDirectoryException extends IgniteFsInvalidPathException {
/** */
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsFileNotFoundException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsFileNotFoundException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsFileNotFoundException.java
index 8106679..def5bc4 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsFileNotFoundException.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsFileNotFoundException.java
@@ -12,7 +12,7 @@ package org.gridgain.grid.ggfs;
/**
* {@code GGFS} exception indicating that target resource is not found.
*/
-public class IgniteFsFileNotFoundException extends GridGgfsInvalidPathException {
+public class IgniteFsFileNotFoundException extends IgniteFsInvalidPathException {
/** */
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInputStream.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInputStream.java
new file mode 100644
index 0000000..8fb669e
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInputStream.java
@@ -0,0 +1,72 @@
+/* @java.file.header */
+
+/* _________ _____ __________________ _____
+ * __ ____/___________(_)______ /__ ____/______ ____(_)_______
+ * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
+ * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
+ * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ */
+
+package org.gridgain.grid.ggfs;
+
+import java.io.*;
+
+/**
+ * {@code GGFS} input stream to read data from the file system.
+ * It provides several additional methods for asynchronous access.
+ */
+public abstract class IgniteFsInputStream extends InputStream implements IgniteFsReader {
+ /**
+ * Gets file length during file open.
+ *
+ * @return File length.
+ */
+ public abstract long length();
+
+ /**
+ * Seek to the specified position.
+ *
+ * @param pos Position to seek to.
+ * @throws IOException In case of IO exception.
+ */
+ public abstract void seek(long pos) throws IOException;
+
+ /**
+ * Get the current position in the input stream.
+ *
+ * @return The current position in the input stream.
+ * @throws IOException In case of IO exception.
+ */
+ public abstract long position() throws IOException;
+
+ /**
+ * Read bytes from the given position in the stream to the given buffer.
+ * Continues to read until passed buffer becomes filled.
+ *
+ * @param pos Position in the input stream to seek.
+ * @param buf Buffer into which data is read.
+ * @throws IOException In case of IO exception.
+ */
+ public abstract void readFully(long pos, byte[] buf) throws IOException;
+
+ /**
+ *
+ * @param pos Position in the input stream to seek.
+ * @param buf Buffer into which data is read.
+ * @param off Offset in the buffer from which stream data should be written.
+ * @param len The number of bytes to read.
+ * @throws IOException In case of IO exception.
+ */
+ public abstract void readFully(long pos, byte[] buf, int off, int len) throws IOException;
+
+ /**
+ *
+ * @param pos Position in the input stream to seek.
+ * @param buf Buffer into which data is read.
+ * @param off Offset in the buffer from which stream data should be written.
+ * @param len The number of bytes to read.
+ * @return Total number of bytes read into the buffer, or -1 if there is no more data (EOF).
+ * @throws IOException In case of IO exception.
+ */
+ @Override public abstract int read(long pos, byte[] buf, int off, int len) throws IOException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInvalidHdfsVersionException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInvalidHdfsVersionException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInvalidHdfsVersionException.java
new file mode 100644
index 0000000..7004311
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInvalidHdfsVersionException.java
@@ -0,0 +1,34 @@
+/* @java.file.header */
+
+/* _________ _____ __________________ _____
+ * __ ____/___________(_)______ /__ ____/______ ____(_)_______
+ * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
+ * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
+ * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ */
+
+package org.gridgain.grid.ggfs;
+
+/**
+ * Exception thrown when GridGain detects that remote HDFS version differs from version of HDFS libraries
+ * in GridGain classpath.
+ */
+public class IgniteFsInvalidHdfsVersionException extends IgniteFsException {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * @param msg Error message.
+ */
+ public IgniteFsInvalidHdfsVersionException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * @param msg Error message.
+ * @param cause Error cause.
+ */
+ public IgniteFsInvalidHdfsVersionException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInvalidPathException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInvalidPathException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInvalidPathException.java
new file mode 100644
index 0000000..0e7fe00
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsInvalidPathException.java
@@ -0,0 +1,49 @@
+/* @java.file.header */
+
+/* _________ _____ __________________ _____
+ * __ ____/___________(_)______ /__ ____/______ ____(_)_______
+ * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
+ * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
+ * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ */
+
+package org.gridgain.grid.ggfs;
+
+import org.jetbrains.annotations.*;
+
+/**
+ * {@code GGFS} exception indicating that operation target is invalid
+ * (e.g. not a file while expecting to be a file).
+ */
+public class IgniteFsInvalidPathException extends IgniteFsException {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Creates exception with given error message.
+ *
+ * @param msg Error message.
+ */
+ public IgniteFsInvalidPathException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Creates exception with given exception cause.
+ *
+ * @param cause Exception cause.
+ */
+ public IgniteFsInvalidPathException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Creates exception with given error message and exception cause.
+ *
+ * @param msg Error message.
+ * @param cause Error cause.
+ */
+ public IgniteFsInvalidPathException(String msg, @Nullable Throwable cause) {
+ super(msg, cause);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsMetrics.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsMetrics.java
new file mode 100644
index 0000000..d4f7fc6
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsMetrics.java
@@ -0,0 +1,151 @@
+/* @java.file.header */
+
+/* _________ _____ __________________ _____
+ * __ ____/___________(_)______ /__ ____/______ ____(_)_______
+ * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
+ * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
+ * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ */
+
+package org.gridgain.grid.ggfs;
+
+/**
+ * {@code GGFS} metrics snapshot for the file system. Note, that some metrics are global and
+ * some are local (i.e. per each node).
+ */
+public interface IgniteFsMetrics {
+ /**
+ * Gets local used space in bytes. This is the sum of all file chunks stored on local node.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Node used space in bytes.
+ */
+ public long localSpaceSize();
+
+ /**
+ * Gets maximum amount of data that can be stored on local node. This metrics is either
+ * equal to {@link IgniteFsConfiguration#getMaxSpaceSize()}, or, if it is {@code 0}, equal to
+ * {@code 80%} of maximum heap size allocated for JVM.
+ *
+ * @return Maximum GGFS local space size.
+ */
+ public long maxSpaceSize();
+
+ /**
+ * Get used space in bytes used in the secondary file system.
+ * <p>
+ * This is a global metric.
+ *
+ * @return Used space in the secondary file system or {@code 0} in case no secondary file system is configured.
+ */
+ public long secondarySpaceSize();
+
+ /**
+ * Gets number of directories created in file system.
+ * <p>
+ * This is a global metric.
+ *
+ * @return Number of directories.
+ */
+ public int directoriesCount();
+
+ /**
+ * Gets number of files stored in file system.
+ * <p>
+ * This is a global metric.
+ *
+ * @return Number of files.
+ */
+ public int filesCount();
+
+ /**
+ * Gets number of files that are currently opened for reading.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Number of opened files.
+ */
+ public int filesOpenedForRead();
+
+ /**
+ * Gets number of files that are currently opened for writing.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Number of opened files.
+ */
+ public int filesOpenedForWrite();
+
+ /**
+ * Gets total blocks read, local and remote.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Total blocks read.
+ */
+ public long blocksReadTotal();
+
+ /**
+ * Gets total remote blocks read.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Total blocks remote read.
+ */
+ public long blocksReadRemote();
+
+ /**
+ * Gets total blocks written, local and remote.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Total blocks written.
+ */
+ public long blocksWrittenTotal();
+
+ /**
+ * Gets total remote blocks written.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Total blocks written.
+ */
+ public long blocksWrittenRemote();
+
+ /**
+ * Gets total bytes read.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Total bytes read.
+ */
+ public long bytesRead();
+
+ /**
+ * Gets total bytes read time.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Total bytes read time.
+ */
+ public long bytesReadTime();
+
+ /**
+ * Gets total bytes written.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Total bytes written.
+ */
+ public long bytesWritten();
+
+ /**
+ * Gets total bytes write time.
+ * <p>
+ * This is a local metric.
+ *
+ * @return Total bytes write time.
+ */
+ public long bytesWriteTime();
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsPathAlreadyExistsException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsPathAlreadyExistsException.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsPathAlreadyExistsException.java
index 7ca2581..4126657 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsPathAlreadyExistsException.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/IgniteFsPathAlreadyExistsException.java
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.*;
/**
* Exception thrown when target path supposed to be created already exists.
*/
-public class IgniteFsPathAlreadyExistsException extends GridGgfsInvalidPathException {
+public class IgniteFsPathAlreadyExistsException extends IgniteFsInvalidPathException {
/** */
private static final long serialVersionUID = 0L;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsInputStreamJobAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsInputStreamJobAdapter.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsInputStreamJobAdapter.java
index 6a1fc3f..a5ac21d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsInputStreamJobAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsInputStreamJobAdapter.java
@@ -17,7 +17,7 @@ import org.gridgain.grid.util.*;
import java.io.*;
/**
- * Convenient {@link GridGgfsJob} adapter. It limits data returned from {@link GridGgfsInputStream} to bytes within
+ * Convenient {@link GridGgfsJob} adapter. It limits data returned from {@link org.gridgain.grid.ggfs.IgniteFsInputStream} to bytes within
* the {@link GridGgfsFileRange} assigned to the job.
* <p>
* Under the covers it simply puts job's {@code GridGgfsInputStream} position to range start and wraps in into
@@ -25,7 +25,7 @@ import java.io.*;
*/
public abstract class GridGgfsInputStreamJobAdapter extends GridGgfsJobAdapter {
/** {@inheritDoc} */
- @Override public final Object execute(IgniteFs ggfs, GridGgfsFileRange range, GridGgfsInputStream in)
+ @Override public final Object execute(IgniteFs ggfs, GridGgfsFileRange range, IgniteFsInputStream in)
throws GridException, IOException {
in.seek(range.start());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsJob.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsJob.java
index ae027db..84617dd 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsJob.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsJob.java
@@ -19,8 +19,8 @@ import java.io.*;
* Defines executable unit for {@link GridGgfsTask}. Before this job is executed, it is assigned one of the
* ranges provided by the {@link GridGgfsRecordResolver} passed to one of the {@code GridGgfs.execute(...)} methods.
* <p>
- * {@link #execute(org.apache.ignite.IgniteFs, GridGgfsFileRange, GridGgfsInputStream)} method is given {@link GridGgfsFileRange} this
- * job is expected to operate on, and already opened {@link GridGgfsInputStream} for the file this range belongs to.
+ * {@link #execute(org.apache.ignite.IgniteFs, GridGgfsFileRange, org.gridgain.grid.ggfs.IgniteFsInputStream)} method is given {@link GridGgfsFileRange} this
+ * job is expected to operate on, and already opened {@link org.gridgain.grid.ggfs.IgniteFsInputStream} for the file this range belongs to.
* <p>
* Note that provided input stream has position already adjusted to range start. However, it will not
* automatically stop on range end. This is done to provide capability in some cases to look beyond
@@ -45,7 +45,7 @@ public interface GridGgfsJob {
* @throws GridException If execution failed.
* @throws IOException If file system operation resulted in IO exception.
*/
- public Object execute(IgniteFs ggfs, GridGgfsFileRange range, GridGgfsInputStream in) throws GridException,
+ public Object execute(IgniteFs ggfs, GridGgfsFileRange range, IgniteFsInputStream in) throws GridException,
IOException;
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRangeInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRangeInputStream.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRangeInputStream.java
index c308f1f..fc0e6be 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRangeInputStream.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRangeInputStream.java
@@ -16,14 +16,14 @@ import org.jetbrains.annotations.*;
import java.io.*;
/**
- * Decorator for regular {@link GridGgfsInputStream} which streams only data within the given range.
+ * Decorator for regular {@link org.gridgain.grid.ggfs.IgniteFsInputStream} which streams only data within the given range.
* This stream is used for {@link GridGgfsInputStreamJobAdapter} convenience adapter to create
* jobs which will be working only with the assigned range. You can also use it explicitly when
* working with {@link GridGgfsJob} directly.
*/
-public final class GridGgfsRangeInputStream extends GridGgfsInputStream {
+public final class GridGgfsRangeInputStream extends IgniteFsInputStream {
/** Base input stream. */
- private final GridGgfsInputStream is;
+ private final IgniteFsInputStream is;
/** Start position. */
private final long start;
@@ -42,7 +42,7 @@ public final class GridGgfsRangeInputStream extends GridGgfsInputStream {
* @param maxLen Maximum stream length.
* @throws IOException In case of exception.
*/
- public GridGgfsRangeInputStream(GridGgfsInputStream is, long start, long maxLen) throws IOException {
+ public GridGgfsRangeInputStream(IgniteFsInputStream is, long start, long maxLen) throws IOException {
if (is == null)
throw new IllegalArgumentException("Input stream cannot be null.");
@@ -77,7 +77,7 @@ public final class GridGgfsRangeInputStream extends GridGgfsInputStream {
* @param range File range.
* @throws IOException In case of exception.
*/
- public GridGgfsRangeInputStream(GridGgfsInputStream is, GridGgfsFileRange range) throws IOException {
+ public GridGgfsRangeInputStream(IgniteFsInputStream is, GridGgfsFileRange range) throws IOException {
this(is, range.start(), range.length());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRecordResolver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRecordResolver.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRecordResolver.java
index 645e646..e8d64d0 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRecordResolver.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/GridGgfsRecordResolver.java
@@ -45,6 +45,6 @@ public interface GridGgfsRecordResolver extends Serializable {
* @throws GridException If resolve failed.
* @throws IOException If resolve failed.
*/
- @Nullable public GridGgfsFileRange resolveRecords(IgniteFs ggfs, GridGgfsInputStream stream,
+ @Nullable public GridGgfsFileRange resolveRecords(IgniteFs ggfs, IgniteFsInputStream stream,
GridGgfsFileRange suggestedRecord) throws GridException, IOException;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsByteDelimiterRecordResolver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsByteDelimiterRecordResolver.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsByteDelimiterRecordResolver.java
index 6fca396..fb9cf0e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsByteDelimiterRecordResolver.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsByteDelimiterRecordResolver.java
@@ -70,7 +70,7 @@ public class GridGgfsByteDelimiterRecordResolver implements GridGgfsRecordResolv
}
/** {@inheritDoc} */
- @Override public GridGgfsFileRange resolveRecords(IgniteFs ggfs, GridGgfsInputStream stream,
+ @Override public GridGgfsFileRange resolveRecords(IgniteFs ggfs, IgniteFsInputStream stream,
GridGgfsFileRange suggestedRecord) throws GridException, IOException {
long suggestedStart = suggestedRecord.start();
long suggestedEnd = suggestedStart + suggestedRecord.length();
@@ -138,7 +138,7 @@ public class GridGgfsByteDelimiterRecordResolver implements GridGgfsRecordResolv
* @return The first found delimiter.
* @throws IOException In case of IO exception.
*/
- @Nullable private IgniteBiTuple<State, Delimiter> findFirstDelimiter(GridGgfsInputStream stream, long startPos)
+ @Nullable private IgniteBiTuple<State, Delimiter> findFirstDelimiter(IgniteFsInputStream stream, long startPos)
throws IOException {
State state;
Delimiter delim;
@@ -169,7 +169,7 @@ public class GridGgfsByteDelimiterRecordResolver implements GridGgfsRecordResolv
* @return Next delimiter and updated map.
* @throws IOException In case of exception.
*/
- private Delimiter nextDelimiter(GridGgfsInputStream is, State state) throws IOException {
+ private Delimiter nextDelimiter(IgniteFsInputStream is, State state) throws IOException {
assert is != null;
assert state != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsFixedLengthRecordResolver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsFixedLengthRecordResolver.java b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsFixedLengthRecordResolver.java
index 5fbd5bd..212b780 100644
--- a/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsFixedLengthRecordResolver.java
+++ b/modules/core/src/main/java/org/gridgain/grid/ggfs/mapreduce/records/GridGgfsFixedLengthRecordResolver.java
@@ -45,7 +45,7 @@ public class GridGgfsFixedLengthRecordResolver implements GridGgfsRecordResolver
}
/** {@inheritDoc} */
- @Override public GridGgfsFileRange resolveRecords(IgniteFs ggfs, GridGgfsInputStream stream,
+ @Override public GridGgfsFileRange resolveRecords(IgniteFs ggfs, IgniteFsInputStream stream,
GridGgfsFileRange suggestedRecord)
throws GridException, IOException {
long suggestedEnd = suggestedRecord.start() + suggestedRecord.length();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java
index 8abd967..919a0cd 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java
@@ -261,7 +261,7 @@ public class GridGgfsControlResponse extends GridGgfsMessage {
else if (errCode == ERR_PARENT_NOT_DIRECTORY)
throw new GridGgfsParentNotDirectoryException(err);
else if (errCode == ERR_INVALID_HDFS_VERSION)
- throw new GridGgfsInvalidHdfsVersionException(err);
+ throw new IgniteFsInvalidHdfsVersionException(err);
else if (errCode == ERR_CORRUPTED_FILE)
throw new IgniteFsCorruptedFileException(err);
else if (errCode == ERR_GGFS_GENERIC)
@@ -332,7 +332,7 @@ public class GridGgfsControlResponse extends GridGgfsMessage {
return ERR_DIRECTORY_NOT_EMPTY;
else if (GridGgfsParentNotDirectoryException.class.isInstance(e))
return ERR_PARENT_NOT_DIRECTORY;
- else if (GridGgfsInvalidHdfsVersionException.class.isInstance(e))
+ else if (IgniteFsInvalidHdfsVersionException.class.isInstance(e))
return ERR_INVALID_HDFS_VERSION;
else if (X.hasCause(e, IgniteFsCorruptedFileException.class))
return ERR_CORRUPTED_FILE;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/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 62726bd..6b33e17 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
@@ -219,7 +219,7 @@ public class GridGgfsAsyncImpl extends IgniteAsyncSupportAdapter implements Grid
}
/** {@inheritDoc} */
- @Override public GridGgfsMetrics metrics() throws GridException {
+ @Override public IgniteFsMetrics metrics() throws GridException {
return ggfs.metrics();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/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 9c804a4..45a8add 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
@@ -630,15 +630,15 @@ public final class GridGgfsImpl implements GridGgfsEx {
// Cannot rename root directory.
if (src.parent() == null)
- throw new GridGgfsInvalidPathException("Failed to rename root directory.");
+ throw new IgniteFsInvalidPathException("Failed to rename root directory.");
// Cannot move directory of upper level to self sub-dir.
if (dest.isSubDirectoryOf(src))
- throw new GridGgfsInvalidPathException("Failed to rename directory (cannot move directory of " +
+ throw new IgniteFsInvalidPathException("Failed to rename directory (cannot move directory of " +
"upper level to self sub-dir) [src=" + src + ", dest=" + dest + ']');
if (evictExclude(src, mode == PRIMARY) != evictExclude(dest, modeRslvr.resolveMode(dest) == PRIMARY))
- throw new GridGgfsInvalidPathException("Cannot move file to a path with different eviction " +
+ throw new IgniteFsInvalidPathException("Cannot move file to a path with different eviction " +
"exclude setting (need to copy and remove)");
if (!childrenModes.equals(Collections.singleton(PRIMARY))) {
@@ -1087,7 +1087,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
if (!info.isFile())
- throw new GridGgfsInvalidPathException("Failed to open file (not a file): " + path);
+ throw new IgniteFsInvalidPathException("Failed to open file (not a file): " + path);
// Input stream to read data from grid cache with separate blocks.
GgfsEventAwareInputStream os = new GgfsEventAwareInputStream(ggfsCtx, path, info,
@@ -1193,7 +1193,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
IgniteUuid parentId = ids.size() >= 2 ? ids.get(ids.size() - 2) : null;
if (parentId == null)
- throw new GridGgfsInvalidPathException("Failed to resolve parent directory: " + path);
+ throw new IgniteFsInvalidPathException("Failed to resolve parent directory: " + path);
String fileName = path.name();
@@ -1298,7 +1298,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
if (parentId == null)
- throw new GridGgfsInvalidPathException("Failed to resolve parent directory: " + path);
+ throw new IgniteFsInvalidPathException("Failed to resolve parent directory: " + path);
info = new GridGgfsFileInfo(cfg.getBlockSize(), /**affinity key*/null, evictExclude(path,
mode == PRIMARY), props);
@@ -1313,7 +1313,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
if (!info.isFile())
- throw new GridGgfsInvalidPathException("Failed to open file (not a file): " + path);
+ throw new IgniteFsInvalidPathException("Failed to open file (not a file): " + path);
info = meta.lock(info.id());
@@ -1417,7 +1417,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
throw new IgniteFsFileNotFoundException("File not found: " + path);
if (!info.isFile())
- throw new GridGgfsInvalidPathException("Failed to get affinity info for file (not a file): " +
+ throw new IgniteFsInvalidPathException("Failed to get affinity info for file (not a file): " +
path);
return data.affinity(info, start, len, maxLen);
@@ -1431,7 +1431,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
/** {@inheritDoc} */
- @Override public GridGgfsMetrics metrics() throws GridException {
+ @Override public IgniteFsMetrics metrics() throws GridException {
if (enterBusy()) {
try {
IgniteFsPathSummary sum = new IgniteFsPathSummary();
@@ -1451,7 +1451,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
}
}
- return new GridGgfsMetricsAdapter(
+ return new IgniteFsMetricsAdapter(
ggfsCtx.data().spaceSize(),
ggfsCtx.data().maxSpaceSize(),
secondarySpaceSize,
@@ -2011,7 +2011,7 @@ public final class GridGgfsImpl implements GridGgfsEx {
if (ggfs == null)
return F.t(0L, 0L);
- GridGgfsMetrics metrics = ggfs.metrics();
+ IgniteFsMetrics metrics = ggfs.metrics();
long loc = metrics.localSpaceSize();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamAdapter.java
index b6b5195..dea1fc2 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamAdapter.java
@@ -16,7 +16,7 @@ import java.io.*;
/**
* Implementation adapter providing necessary methods.
*/
-public abstract class GridGgfsInputStreamAdapter extends GridGgfsInputStream {
+public abstract class GridGgfsInputStreamAdapter extends IgniteFsInputStream {
/** {@inheritDoc} */
@Override public long length() {
return fileInfo().length();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/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 da60ae4..91e0b4a 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
@@ -118,7 +118,7 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter {
meta = ggfsCtx.meta();
data = ggfsCtx.data();
- log = ggfsCtx.kernalContext().log(GridGgfsInputStream.class);
+ log = ggfsCtx.kernalContext().log(IgniteFsInputStream.class);
maxLocCacheSize = (prefetchBlocks > 0 ? prefetchBlocks : 1) * 3 / 2;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/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 3ef20fe..f460d5d 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
@@ -74,7 +74,7 @@ public class GridGgfsJobImpl implements ComputeJob, GridInternalWrapper<GridGgfs
@Override public Object execute() throws GridException {
IgniteFs ggfs = ignite.fileSystem(ggfsName);
- try (GridGgfsInputStream in = ggfs.open(path)) {
+ try (IgniteFsInputStream in = ggfs.open(path)) {
GridGgfsFileRange split = new GridGgfsFileRange(path, start, len);
if (rslvr != null) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/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 2db4380..eb862f2 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
@@ -730,7 +730,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
throw new IgniteFsFileNotFoundException("Failed to lock parent directory (not found): " + parentId);
if (!parentInfo.isDirectory())
- throw new GridGgfsInvalidPathException("Parent file is not a directory: " + parentInfo);
+ throw new IgniteFsInvalidPathException("Parent file is not a directory: " + parentInfo);
Map<String, GridGgfsListingEntry> parentListing = parentInfo.listing();
@@ -831,7 +831,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
" [srcParentId=" + srcParentId + ']');
if (!srcInfo.isDirectory())
- throw new GridGgfsInvalidPathException("Source is not a directory: " + srcInfo);
+ throw new IgniteFsInvalidPathException("Source is not a directory: " + srcInfo);
GridGgfsFileInfo destInfo = infoMap.get(destParentId);
@@ -840,7 +840,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
" [destParentId=" + destParentId + ']');
if (!destInfo.isDirectory())
- throw new GridGgfsInvalidPathException("Destination is not a directory: " + destInfo);
+ throw new IgniteFsInvalidPathException("Destination is not a directory: " + destInfo);
GridGgfsFileInfo fileInfo = infoMap.get(fileId);
@@ -859,7 +859,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
// If stored file already exist.
if (destEntry != null)
- throw new GridGgfsInvalidPathException("Failed to add file name into the destination directory " +
+ throw new IgniteFsInvalidPathException("Failed to add file name into the destination directory " +
"(file already exists) [fileId=" + fileId + ", destFileName=" + destFileName +
", destParentId=" + destParentId + ", destEntry=" + destEntry + ']');
@@ -1833,7 +1833,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
if (info != null) {
if (!info.isFile())
- throw new GridGgfsInvalidPathException("Failed to open file (not a file): " + path);
+ throw new IgniteFsInvalidPathException("Failed to open file (not a file): " + path);
return new GridGgfsSecondaryInputStreamDescriptor(info, fs.open(path, bufSize));
}
@@ -1848,7 +1848,7 @@ public class GridGgfsMetaManager extends GridGgfsManager {
if (info == null)
throw new IgniteFsFileNotFoundException("File not found: " + path);
if (!info.isFile())
- throw new GridGgfsInvalidPathException("Failed to open file (not a file): " + path);
+ throw new IgniteFsInvalidPathException("Failed to open file (not a file): " + path);
return new GridGgfsSecondaryInputStreamDescriptor(infos.get(path), fs.open(path, bufSize));
}
@@ -2587,14 +2587,14 @@ public class GridGgfsMetaManager extends GridGgfsManager {
GridGgfsFileInfo parentInfo = infoMap.get(parentId);
if (parentInfo == null)
- throw new GridGgfsInvalidPathException("Failed to update times (parent was not found): " +
+ throw new IgniteFsInvalidPathException("Failed to update times (parent was not found): " +
fileName);
GridGgfsListingEntry entry = parentInfo.listing().get(fileName);
// Validate listing.
if (entry == null || !entry.fileId().equals(fileId))
- throw new GridGgfsInvalidPathException("Failed to update times (file concurrently modified): " +
+ throw new IgniteFsInvalidPathException("Failed to update times (file concurrently modified): " +
fileName);
assert parentInfo.isDirectory();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsAdapter.java
deleted file mode 100644
index 574ccab..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsAdapter.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/* @java.file.header */
-
-/* _________ _____ __________________ _____
- * __ ____/___________(_)______ /__ ____/______ ____(_)_______
- * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
- * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
- * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
- */
-
-package org.gridgain.grid.kernal.processors.ggfs;
-
-import org.gridgain.grid.ggfs.*;
-import org.gridgain.grid.util.typedef.internal.*;
-
-import java.io.*;
-
-/**
- * GGFS metrics adapter.
- */
-public class GridGgfsMetricsAdapter implements GridGgfsMetrics, Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Used space on local node. */
- private long locSpaceSize;
-
- /** Maximum space. */
- private long maxSpaceSize;
-
- /** Secondary file system used space. */
- private long secondarySpaceSize;
-
- /** Number of directories. */
- private int dirsCnt;
-
- /** Number of files. */
- private int filesCnt;
-
- /** Number of files opened for read. */
- private int filesOpenedForRead;
-
- /** Number of files opened for write. */
- private int filesOpenedForWrite;
-
- /** Total blocks read. */
- private long blocksReadTotal;
-
- /** Total blocks remote read. */
- private long blocksReadRmt;
-
- /** Total blocks write. */
- private long blocksWrittenTotal;
-
- /** Total blocks write remote. */
- private long blocksWrittenRmt;
-
- /** Total bytes read. */
- private long bytesRead;
-
- /** Total bytes read time. */
- private long bytesReadTime;
-
- /** Total bytes write. */
- private long bytesWritten;
-
- /** Total bytes write time. */
- private long bytesWriteTime;
-
- /**
- * {@link Externalizable} support.
- */
- public GridGgfsMetricsAdapter() {
- // No-op.
- }
-
- /**
- * @param locSpaceSize Used space on local node.
- * @param maxSpaceSize Maximum space size.
- * @param secondarySpaceSize Secondary space size.
- * @param dirsCnt Number of directories.
- * @param filesCnt Number of files.
- * @param filesOpenedForRead Number of files opened for read.
- * @param filesOpenedForWrite Number of files opened for write.
- * @param blocksReadTotal Total blocks read.
- * @param blocksReadRmt Total blocks read remotely.
- * @param blocksWrittenTotal Total blocks written.
- * @param blocksWrittenRmt Total blocks written remotely.
- * @param bytesRead Total bytes read.
- * @param bytesReadTime Total bytes read time.
- * @param bytesWritten Total bytes written.
- * @param bytesWriteTime Total bytes write time.
- */
- public GridGgfsMetricsAdapter(long locSpaceSize, long maxSpaceSize, long secondarySpaceSize, int dirsCnt,
- int filesCnt, int filesOpenedForRead, int filesOpenedForWrite, long blocksReadTotal, long blocksReadRmt,
- long blocksWrittenTotal, long blocksWrittenRmt, long bytesRead, long bytesReadTime, long bytesWritten,
- long bytesWriteTime) {
- this.locSpaceSize = locSpaceSize;
- this.maxSpaceSize = maxSpaceSize;
- this.secondarySpaceSize = secondarySpaceSize;
- this.dirsCnt = dirsCnt;
- this.filesCnt = filesCnt;
- this.filesOpenedForRead = filesOpenedForRead;
- this.filesOpenedForWrite = filesOpenedForWrite;
- this.blocksReadTotal = blocksReadTotal;
- this.blocksReadRmt = blocksReadRmt;
- this.blocksWrittenTotal = blocksWrittenTotal;
- this.blocksWrittenRmt = blocksWrittenRmt;
- this.bytesRead = bytesRead;
- this.bytesReadTime = bytesReadTime;
- this.bytesWritten = bytesWritten;
- this.bytesWriteTime = bytesWriteTime;
- }
-
- /** {@inheritDoc} */
- @Override public long localSpaceSize() {
- return locSpaceSize;
- }
-
- /** {@inheritDoc} */
- @Override public long maxSpaceSize() {
- return maxSpaceSize;
- }
-
- /** {@inheritDoc} */
- @Override public long secondarySpaceSize() {
- return secondarySpaceSize;
- }
-
- /** {@inheritDoc} */
- @Override public int directoriesCount() {
- return dirsCnt;
- }
-
- /** {@inheritDoc} */
- @Override public int filesCount() {
- return filesCnt;
- }
-
- /** {@inheritDoc} */
- @Override public int filesOpenedForRead() {
- return filesOpenedForRead;
- }
-
- /** {@inheritDoc} */
- @Override public int filesOpenedForWrite() {
- return filesOpenedForWrite;
- }
-
- /** {@inheritDoc} */
- @Override public long blocksReadTotal() {
- return blocksReadTotal;
- }
-
- /** {@inheritDoc} */
- @Override public long blocksReadRemote() {
- return blocksReadRmt;
- }
-
- /** {@inheritDoc} */
- @Override public long blocksWrittenTotal() {
- return blocksWrittenTotal;
- }
-
- /** {@inheritDoc} */
- @Override public long blocksWrittenRemote() {
- return blocksWrittenRmt;
- }
-
- /** {@inheritDoc} */
- @Override public long bytesRead() {
- return bytesRead;
- }
-
- /** {@inheritDoc} */
- @Override public long bytesReadTime() {
- return bytesReadTime;
- }
-
- /** {@inheritDoc} */
- @Override public long bytesWritten() {
- return bytesWritten;
- }
-
- /** {@inheritDoc} */
- @Override public long bytesWriteTime() {
- return bytesWriteTime;
- }
-
- /** {@inheritDoc} */
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- out.writeLong(locSpaceSize);
- out.writeLong(maxSpaceSize);
- out.writeLong(secondarySpaceSize);
- out.writeInt(dirsCnt);
- out.writeInt(filesCnt);
- out.writeInt(filesOpenedForRead);
- out.writeInt(filesOpenedForWrite);
- out.writeLong(blocksReadTotal);
- out.writeLong(blocksReadRmt);
- out.writeLong(blocksWrittenTotal);
- out.writeLong(blocksWrittenRmt);
- out.writeLong(bytesRead);
- out.writeLong(bytesReadTime);
- out.writeLong(bytesWritten);
- out.writeLong(bytesWriteTime);
- }
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException {
- locSpaceSize = in.readLong();
- maxSpaceSize = in.readLong();
- secondarySpaceSize = in.readLong();
- dirsCnt = in.readInt();
- filesCnt = in.readInt();
- filesOpenedForRead = in.readInt();
- filesOpenedForWrite = in.readInt();
- blocksReadTotal = in.readLong();
- blocksReadRmt = in.readLong();
- blocksWrittenTotal = in.readLong();
- blocksWrittenRmt = in.readLong();
- bytesRead = in.readLong();
- bytesReadTime = in.readLong();
- bytesWritten = in.readLong();
- bytesWriteTime = in.readLong();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(GridGgfsMetricsAdapter.class, this);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/IgniteFsMetricsAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/IgniteFsMetricsAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/IgniteFsMetricsAdapter.java
new file mode 100644
index 0000000..36627f8
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/IgniteFsMetricsAdapter.java
@@ -0,0 +1,231 @@
+/* @java.file.header */
+
+/* _________ _____ __________________ _____
+ * __ ____/___________(_)______ /__ ____/______ ____(_)_______
+ * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
+ * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
+ * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
+ */
+
+package org.gridgain.grid.kernal.processors.ggfs;
+
+import org.gridgain.grid.ggfs.*;
+import org.gridgain.grid.util.typedef.internal.*;
+
+import java.io.*;
+
+/**
+ * GGFS metrics adapter.
+ */
+public class IgniteFsMetricsAdapter implements IgniteFsMetrics, Externalizable {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** Used space on local node. */
+ private long locSpaceSize;
+
+ /** Maximum space. */
+ private long maxSpaceSize;
+
+ /** Secondary file system used space. */
+ private long secondarySpaceSize;
+
+ /** Number of directories. */
+ private int dirsCnt;
+
+ /** Number of files. */
+ private int filesCnt;
+
+ /** Number of files opened for read. */
+ private int filesOpenedForRead;
+
+ /** Number of files opened for write. */
+ private int filesOpenedForWrite;
+
+ /** Total blocks read. */
+ private long blocksReadTotal;
+
+ /** Total blocks remote read. */
+ private long blocksReadRmt;
+
+ /** Total blocks write. */
+ private long blocksWrittenTotal;
+
+ /** Total blocks write remote. */
+ private long blocksWrittenRmt;
+
+ /** Total bytes read. */
+ private long bytesRead;
+
+ /** Total bytes read time. */
+ private long bytesReadTime;
+
+ /** Total bytes write. */
+ private long bytesWritten;
+
+ /** Total bytes write time. */
+ private long bytesWriteTime;
+
+ /**
+ * {@link Externalizable} support.
+ */
+ public IgniteFsMetricsAdapter() {
+ // No-op.
+ }
+
+ /**
+ * @param locSpaceSize Used space on local node.
+ * @param maxSpaceSize Maximum space size.
+ * @param secondarySpaceSize Secondary space size.
+ * @param dirsCnt Number of directories.
+ * @param filesCnt Number of files.
+ * @param filesOpenedForRead Number of files opened for read.
+ * @param filesOpenedForWrite Number of files opened for write.
+ * @param blocksReadTotal Total blocks read.
+ * @param blocksReadRmt Total blocks read remotely.
+ * @param blocksWrittenTotal Total blocks written.
+ * @param blocksWrittenRmt Total blocks written remotely.
+ * @param bytesRead Total bytes read.
+ * @param bytesReadTime Total bytes read time.
+ * @param bytesWritten Total bytes written.
+ * @param bytesWriteTime Total bytes write time.
+ */
+ public IgniteFsMetricsAdapter(long locSpaceSize, long maxSpaceSize, long secondarySpaceSize, int dirsCnt,
+ int filesCnt, int filesOpenedForRead, int filesOpenedForWrite, long blocksReadTotal, long blocksReadRmt,
+ long blocksWrittenTotal, long blocksWrittenRmt, long bytesRead, long bytesReadTime, long bytesWritten,
+ long bytesWriteTime) {
+ this.locSpaceSize = locSpaceSize;
+ this.maxSpaceSize = maxSpaceSize;
+ this.secondarySpaceSize = secondarySpaceSize;
+ this.dirsCnt = dirsCnt;
+ this.filesCnt = filesCnt;
+ this.filesOpenedForRead = filesOpenedForRead;
+ this.filesOpenedForWrite = filesOpenedForWrite;
+ this.blocksReadTotal = blocksReadTotal;
+ this.blocksReadRmt = blocksReadRmt;
+ this.blocksWrittenTotal = blocksWrittenTotal;
+ this.blocksWrittenRmt = blocksWrittenRmt;
+ this.bytesRead = bytesRead;
+ this.bytesReadTime = bytesReadTime;
+ this.bytesWritten = bytesWritten;
+ this.bytesWriteTime = bytesWriteTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long localSpaceSize() {
+ return locSpaceSize;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long maxSpaceSize() {
+ return maxSpaceSize;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long secondarySpaceSize() {
+ return secondarySpaceSize;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int directoriesCount() {
+ return dirsCnt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int filesCount() {
+ return filesCnt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int filesOpenedForRead() {
+ return filesOpenedForRead;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int filesOpenedForWrite() {
+ return filesOpenedForWrite;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long blocksReadTotal() {
+ return blocksReadTotal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long blocksReadRemote() {
+ return blocksReadRmt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long blocksWrittenTotal() {
+ return blocksWrittenTotal;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long blocksWrittenRemote() {
+ return blocksWrittenRmt;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long bytesRead() {
+ return bytesRead;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long bytesReadTime() {
+ return bytesReadTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long bytesWritten() {
+ return bytesWritten;
+ }
+
+ /** {@inheritDoc} */
+ @Override public long bytesWriteTime() {
+ return bytesWriteTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeLong(locSpaceSize);
+ out.writeLong(maxSpaceSize);
+ out.writeLong(secondarySpaceSize);
+ out.writeInt(dirsCnt);
+ out.writeInt(filesCnt);
+ out.writeInt(filesOpenedForRead);
+ out.writeInt(filesOpenedForWrite);
+ out.writeLong(blocksReadTotal);
+ out.writeLong(blocksReadRmt);
+ out.writeLong(blocksWrittenTotal);
+ out.writeLong(blocksWrittenRmt);
+ out.writeLong(bytesRead);
+ out.writeLong(bytesReadTime);
+ out.writeLong(bytesWritten);
+ out.writeLong(bytesWriteTime);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException {
+ locSpaceSize = in.readLong();
+ maxSpaceSize = in.readLong();
+ secondarySpaceSize = in.readLong();
+ dirsCnt = in.readInt();
+ filesCnt = in.readInt();
+ filesOpenedForRead = in.readInt();
+ filesOpenedForWrite = in.readInt();
+ blocksReadTotal = in.readLong();
+ blocksReadRmt = in.readLong();
+ blocksWrittenTotal = in.readLong();
+ blocksWrittenRmt = in.readLong();
+ bytesRead = in.readLong();
+ bytesReadTime = in.readLong();
+ bytesWritten = in.readLong();
+ bytesWriteTime = in.readLong();
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(IgniteFsMetricsAdapter.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/main/java/org/gridgain/grid/kernal/visor/ggfs/VisorGgfsMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/ggfs/VisorGgfsMetrics.java b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/ggfs/VisorGgfsMetrics.java
index ce43815..67ff249 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/ggfs/VisorGgfsMetrics.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/ggfs/VisorGgfsMetrics.java
@@ -15,7 +15,7 @@ import org.gridgain.grid.util.typedef.internal.*;
import java.io.*;
/**
- * Data transfer object for {@link GridGgfsMetrics}.
+ * Data transfer object for {@link org.gridgain.grid.ggfs.IgniteFsMetrics}.
*/
public class VisorGgfsMetrics implements Serializable {
/** */
@@ -67,7 +67,7 @@ public class VisorGgfsMetrics implements Serializable {
* @param m GGFS metrics.
* @return Data transfer object for given GGFS metrics.
*/
- public static VisorGgfsMetrics from(GridGgfsMetrics m) {
+ public static VisorGgfsMetrics from(IgniteFsMetrics m) {
assert m != null;
VisorGgfsMetrics metrics = new VisorGgfsMetrics();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsEventsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsEventsAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsEventsAbstractSelfTest.java
index 9254490..bf46e18 100644
--- a/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsEventsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsEventsAbstractSelfTest.java
@@ -781,7 +781,7 @@ public abstract class GridGgfsEventsAbstractSelfTest extends GridCommonAbstractT
}
// Will generate EVT_GGFS_FILE_OPENED_READ, GGFS_FILE_CLOSED_READ.
- try (GridGgfsInputStream is = ggfs.open(file, 256)) {
+ try (IgniteFsInputStream is = ggfs.open(file, 256)) {
is.readFully(0, buf); // Will generate no events.
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsFragmentizerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsFragmentizerSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsFragmentizerSelfTest.java
index 67169eb..08e88b8 100644
--- a/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsFragmentizerSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/ggfs/GridGgfsFragmentizerSelfTest.java
@@ -46,7 +46,7 @@ public class GridGgfsFragmentizerSelfTest extends GridGgfsFragmentizerAbstractSe
long start = System.currentTimeMillis();
do {
- try (GridGgfsInputStream in = ggfs.open(path)) {
+ try (IgniteFsInputStream in = ggfs.open(path)) {
for (int i = 0; i < 10 * GGFS_GROUP_SIZE; i++) {
for (int j = 0; j < GGFS_BLOCK_SIZE; j++)
assertEquals(i & 0xFF, in.read());
@@ -125,7 +125,7 @@ public class GridGgfsFragmentizerSelfTest extends GridGgfsFragmentizerAbstractSe
IgniteFs ggfs = grid(0).fileSystem("ggfs");
- try (GridGgfsInputStream in = ggfs.open(path)) {
+ try (IgniteFsInputStream in = ggfs.open(path)) {
i = 0;
int read = 0;
@@ -192,7 +192,7 @@ public class GridGgfsFragmentizerSelfTest extends GridGgfsFragmentizerAbstractSe
}
}
- try (GridGgfsInputStream in = ggfs.open(path)) {
+ try (IgniteFsInputStream in = ggfs.open(path)) {
cnt = 0;
int read = 0;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridCacheGgfsPerBlockLruEvictionPolicySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridCacheGgfsPerBlockLruEvictionPolicySelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridCacheGgfsPerBlockLruEvictionPolicySelfTest.java
index b21ba0d..01d6586 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridCacheGgfsPerBlockLruEvictionPolicySelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridCacheGgfsPerBlockLruEvictionPolicySelfTest.java
@@ -318,7 +318,7 @@ public class GridCacheGgfsPerBlockLruEvictionPolicySelfTest extends GridGgfsComm
return null;
}
- }, GridGgfsInvalidPathException.class, "Cannot move file to a path with different eviction exclude setting " +
+ }, IgniteFsInvalidPathException.class, "Cannot move file to a path with different eviction exclude setting " +
"(need to copy and remove)");
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -327,7 +327,7 @@ public class GridCacheGgfsPerBlockLruEvictionPolicySelfTest extends GridGgfsComm
return null;
}
- }, GridGgfsInvalidPathException.class, "Cannot move file to a path with different eviction exclude setting " +
+ }, IgniteFsInvalidPathException.class, "Cannot move file to a path with different eviction exclude setting " +
"(need to copy and remove)");
}
@@ -422,7 +422,7 @@ public class GridCacheGgfsPerBlockLruEvictionPolicySelfTest extends GridGgfsComm
* @throws Exception If failed.
*/
private void read(IgniteFsPath path, int off, int len) throws Exception {
- GridGgfsInputStream is = ggfsPrimary.open(path);
+ IgniteFsInputStream is = ggfsPrimary.open(path);
is.readFully(off, new byte[len]);
@@ -455,7 +455,7 @@ public class GridCacheGgfsPerBlockLruEvictionPolicySelfTest extends GridGgfsComm
assert GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override public boolean apply() {
try {
- GridGgfsMetrics metrics = ggfsPrimary.metrics();
+ IgniteFsMetrics metrics = ggfsPrimary.metrics();
return metrics.blocksReadTotal() == blocksRead && metrics.blocksReadRemote() == blocksReadRmt;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAbstractSelfTest.java
index c7dcfb4..f722fdd 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAbstractSelfTest.java
@@ -853,7 +853,7 @@ public abstract class GridGgfsAbstractSelfTest extends GridGgfsCommonAbstractTes
GridTestUtils.assertThrows(log(), new Callable<Object>() {
@Override public Object call() throws Exception {
- GridGgfsInputStream is = null;
+ IgniteFsInputStream is = null;
try {
is = ggfs.open(FILE);
@@ -2339,7 +2339,7 @@ public abstract class GridGgfsAbstractSelfTest extends GridGgfsCommonAbstractTes
protected void checkFileContent(GridGgfsImpl ggfs, IgniteFsPath file, @Nullable byte[]... chunks)
throws IOException, GridException {
if (chunks != null && chunks.length > 0) {
- GridGgfsInputStream is = null;
+ IgniteFsInputStream is = null;
try {
is = ggfs.open(file);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDualAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDualAbstractSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDualAbstractSelfTest.java
index 57fadf9..9df3b88 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDualAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDualAbstractSelfTest.java
@@ -1145,7 +1145,7 @@ public abstract class GridGgfsDualAbstractSelfTest extends GridGgfsAbstractSelfT
// Read the first block.
int totalRead = 0;
- GridGgfsInputStream in = ggfs.open(FILE, blockSize);
+ IgniteFsInputStream in = ggfs.open(FILE, blockSize);
final byte[] readBuf = new byte[1024];
@@ -1176,7 +1176,7 @@ public abstract class GridGgfsDualAbstractSelfTest extends GridGgfsAbstractSelfT
// Let's wait for file will be deleted.
U.sleep(300);
- final GridGgfsInputStream in0 = in;
+ final IgniteFsInputStream in0 = in;
// Try reading the second block. Should fail.
GridTestUtils.assertThrows(log, new Callable<Object>() {
@@ -1224,7 +1224,7 @@ public abstract class GridGgfsDualAbstractSelfTest extends GridGgfsAbstractSelfT
// Read the first two blocks.
int totalRead = 0;
- GridGgfsInputStream in = ggfs.open(FILE, blockSize);
+ IgniteFsInputStream in = ggfs.open(FILE, blockSize);
final byte[] readBuf = new byte[1024];
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsSelfTest.java
index 84a6736..efd5418 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetricsSelfTest.java
@@ -203,7 +203,7 @@ public class GridGgfsMetricsSelfTest extends GridGgfsCommonAbstractTest {
assertNotNull(fs);
- GridGgfsMetrics m = fs.metrics();
+ IgniteFsMetrics m = fs.metrics();
assertNotNull(m);
assertEquals(0, m.directoriesCount());
@@ -293,8 +293,8 @@ public class GridGgfsMetricsSelfTest extends GridGgfsCommonAbstractTest {
assertEquals(0, m.filesOpenedForRead());
assertEquals(0, m.filesOpenedForWrite());
- GridGgfsInputStream in1 = fs.open(new IgniteFsPath("/dir1/file1"));
- GridGgfsInputStream in2 = fs.open(new IgniteFsPath("/dir1/file2"));
+ IgniteFsInputStream in1 = fs.open(new IgniteFsPath("/dir1/file1"));
+ IgniteFsInputStream in2 = fs.open(new IgniteFsPath("/dir1/file2"));
m = fs.metrics();
@@ -346,12 +346,12 @@ public class GridGgfsMetricsSelfTest extends GridGgfsCommonAbstractTest {
out.close();
out.close();
- GridGgfsInputStream in = fs.open(new IgniteFsPath("/file"));
+ IgniteFsInputStream in = fs.open(new IgniteFsPath("/file"));
in.close();
in.close();
- GridGgfsMetrics m = fs.metrics();
+ IgniteFsMetrics m = fs.metrics();
assertEquals(0, m.filesOpenedForWrite());
assertEquals(0, m.filesOpenedForRead());
@@ -378,7 +378,7 @@ public class GridGgfsMetricsSelfTest extends GridGgfsCommonAbstractTest {
out.close();
// Start metrics measuring.
- GridGgfsMetrics initMetrics = ggfs.metrics();
+ IgniteFsMetrics initMetrics = ggfs.metrics();
// Create empty file.
ggfs.create(file1, 256, true, null, 1, 256, null).close();
@@ -442,7 +442,7 @@ public class GridGgfsMetricsSelfTest extends GridGgfsCommonAbstractTest {
checkBlockMetrics(initMetrics, ggfs.metrics(), 5, 1, blockSize * 3 + rmtBlockSize * 2, 3, 0, blockSize * 3);
- GridGgfsMetrics metrics = ggfs.metrics();
+ IgniteFsMetrics metrics = ggfs.metrics();
assert metrics.secondarySpaceSize() == rmtBlockSize;
@@ -510,7 +510,7 @@ public class GridGgfsMetricsSelfTest extends GridGgfsCommonAbstractTest {
* @param bytesWrite Bytes write.
* @throws Exception If failed.
*/
- private void checkBlockMetrics(GridGgfsMetrics initMetrics, GridGgfsMetrics metrics, long blocksRead,
+ private void checkBlockMetrics(IgniteFsMetrics initMetrics, IgniteFsMetrics metrics, long blocksRead,
long blocksReadRemote, long bytesRead, long blocksWrite, long blocksWriteRemote, long bytesWrite)
throws Exception {
assert metrics != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d26f5fd/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java
index 4a7d98b..1323c4b 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsModesSelfTest.java
@@ -529,7 +529,7 @@ public class GridGgfsModesSelfTest extends GridGgfsCommonAbstractTest {
os.close();
// Check file content.
- GridGgfsInputStream is = ggfs.open(file);
+ IgniteFsInputStream is = ggfs.open(file);
assertEquals(testData.length, is.length());
@@ -547,7 +547,7 @@ public class GridGgfsModesSelfTest extends GridGgfsCommonAbstractTest {
// In ASYNC mode we wait at most 2 seconds for background writer to finish.
for (int i = 0; i < 20; i++) {
- GridGgfsInputStream isSecondary = null;
+ IgniteFsInputStream isSecondary = null;
try {
isSecondary = ggfsSecondary.open(file);
@@ -562,7 +562,7 @@ public class GridGgfsModesSelfTest extends GridGgfsCommonAbstractTest {
}
}
- GridGgfsInputStream isSecondary = ggfsSecondary.open(file);
+ IgniteFsInputStream isSecondary = ggfsSecondary.open(file);
assertEquals(testData.length, isSecondary.length());