Skip to content

Commit

Permalink
# IGNITE-226: WIP (11)
Browse files Browse the repository at this point in the history
  • Loading branch information
vozerov-gridgain committed Feb 13, 2015
1 parent 639ff50 commit 19c7b35
Show file tree
Hide file tree
Showing 124 changed files with 610 additions and 826 deletions.
2 changes: 1 addition & 1 deletion examples/config/filesystem/example-ignitefs.xml
Expand Up @@ -122,7 +122,7 @@
<property name="distributionMode" value="PARTITIONED_ONLY"/>
<property name="backups" value="0"/>
<property name="affinityMapper">
<bean class="org.apache.ignite.ignitefs.IgniteFsGroupDataBlocksKeyMapper">
<bean class="org.apache.ignite.ignitefs.IgfsGroupDataBlocksKeyMapper">
<!-- Haw many blocks in row will be stored on the same node. -->
<constructor-arg value="512"/>
</bean>
Expand Down
Expand Up @@ -120,7 +120,7 @@ private static void delete(IgniteFs fs, IgfsPath path) throws IgniteException {
System.out.println();
System.out.println(">>> Deleted " + (isFile ? "file" : "directory") + ": " + path);
}
catch (IgniteFsException e) {
catch (IgfsException e) {
System.out.println();
System.out.println(">>> Failed to delete " + (isFile ? "file" : "directory") + " [path=" + path +
", msg=" + e.getMessage() + ']');
Expand Down Expand Up @@ -149,7 +149,7 @@ private static void mkdirs(IgniteFs fs, IgfsPath path) throws IgniteException {
System.out.println();
System.out.println(">>> Created directory: " + path);
}
catch (IgniteFsException e) {
catch (IgfsException e) {
System.out.println();
System.out.println(">>> Failed to create a directory [path=" + path + ", msg=" + e.getMessage() + ']');
}
Expand Down
Expand Up @@ -99,7 +99,7 @@ private static void writeFile(IgniteFs fs, IgfsPath fsPath, File file) throws Ex
System.out.println("Copying file to IgniteFs: " + file);

try (
IgniteFsOutputStream os = fs.create(fsPath, true);
IgfsOutputStream os = fs.create(fsPath, true);
FileInputStream fis = new FileInputStream(file)
) {
byte[] buf = new byte[2048];
Expand Down
16 changes: 8 additions & 8 deletions modules/core/src/main/java/org/apache/ignite/IgniteFs.java
Expand Up @@ -129,7 +129,7 @@ public interface IgniteFs extends Igfs, IgniteAsyncSupport {
* @return File output stream to write data to.
* @throws IgniteException In case of error.
*/
@Override public IgniteFsOutputStream create(IgfsPath path, boolean overwrite) throws IgniteException;
@Override public IgfsOutputStream create(IgfsPath path, boolean overwrite) throws IgniteException;

/**
* Creates a file and opens it for writing.
Expand All @@ -143,7 +143,7 @@ public interface IgniteFs extends Igfs, IgniteAsyncSupport {
* @return File output stream to write data to.
* @throws IgniteException In case of error.
*/
@Override public IgniteFsOutputStream create(IgfsPath path, int bufSize, boolean overwrite, int replication,
@Override public IgfsOutputStream create(IgfsPath path, int bufSize, boolean overwrite, int replication,
long blockSize, @Nullable Map<String, String> props) throws IgniteException;

/**
Expand All @@ -160,7 +160,7 @@ public interface IgniteFs extends Igfs, IgniteAsyncSupport {
* @return File output stream to write data to.
* @throws IgniteException In case of error.
*/
public IgniteFsOutputStream create(IgfsPath path, int bufSize, boolean overwrite,
public IgfsOutputStream create(IgfsPath path, int bufSize, boolean overwrite,
@Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map<String, String> props)
throws IgniteException;

Expand All @@ -173,7 +173,7 @@ public IgniteFsOutputStream create(IgfsPath path, int bufSize, boolean overwrite
* @throws IgniteException In case of error.
* @throws org.apache.ignite.ignitefs.IgfsFileNotFoundException If path doesn't exist and create flag is {@code false}.
*/
public IgniteFsOutputStream append(IgfsPath path, boolean create) throws IgniteException;
public IgfsOutputStream append(IgfsPath path, boolean create) throws IgniteException;

/**
* Opens an output stream to an existing file for appending data.
Expand All @@ -186,7 +186,7 @@ public IgniteFsOutputStream create(IgfsPath path, int bufSize, boolean overwrite
* @throws IgniteException In case of error.
* @throws org.apache.ignite.ignitefs.IgfsFileNotFoundException If path doesn't exist and create flag is {@code false}.
*/
@Override public IgniteFsOutputStream append(IgfsPath path, int bufSize, boolean create,
@Override public IgfsOutputStream append(IgfsPath path, int bufSize, boolean create,
@Nullable Map<String, String> props) throws IgniteException;

/**
Expand All @@ -213,7 +213,7 @@ public IgniteFsOutputStream create(IgfsPath path, int bufSize, boolean overwrite
* @throws IgniteException In case of error.
* @throws org.apache.ignite.ignitefs.IgfsFileNotFoundException If path doesn't exist.
*/
public Collection<IgniteFsBlockLocation> affinity(IgfsPath path, long start, long len) throws IgniteException;
public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len) throws IgniteException;

/**
* Get affinity block locations for data blocks of the file. In case {@code maxLen} parameter is set and
Expand All @@ -228,7 +228,7 @@ public IgniteFsOutputStream create(IgfsPath path, int bufSize, boolean overwrite
* @throws IgniteException In case of error.
* @throws org.apache.ignite.ignitefs.IgfsFileNotFoundException If path doesn't exist.
*/
public Collection<IgniteFsBlockLocation> affinity(IgfsPath path, long start, long len, long maxLen)
public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len, long maxLen)
throws IgniteException;

/**
Expand All @@ -237,7 +237,7 @@ public Collection<IgniteFsBlockLocation> affinity(IgfsPath path, long start, lon
* @return Metrics.
* @throws IgniteException In case of error.
*/
public IgniteFsMetrics metrics() throws IgniteException;
public IgfsMetrics metrics() throws IgniteException;

/**
* Resets metrics for this file system.
Expand Down
Expand Up @@ -67,7 +67,7 @@ public class IgniteFsConfiguration {
public static final int DFLT_PER_NODE_PARALLEL_BATCH_CNT = 8;

/** Default GGFS mode. */
public static final IgniteFsMode DFLT_MODE = IgniteFsMode.DUAL_ASYNC;
public static final IgfsMode DFLT_MODE = IgfsMode.DUAL_ASYNC;

/** Default file's data block size (bytes). */
public static final int DFLT_BLOCK_SIZE = 1 << 16;
Expand Down Expand Up @@ -124,7 +124,7 @@ public class IgniteFsConfiguration {
private Igfs secondaryFs;

/** GGFS mode. */
private IgniteFsMode dfltMode = DFLT_MODE;
private IgfsMode dfltMode = DFLT_MODE;

/** Fragmentizer throttling block length. */
private long fragmentizerThrottlingBlockLen = DFLT_FRAGMENTIZER_THROTTLING_BLOCK_LENGTH;
Expand All @@ -142,7 +142,7 @@ public class IgniteFsConfiguration {
private boolean fragmentizerEnabled = DFLT_FRAGMENTIZER_ENABLED;

/** Path modes. */
private Map<String, IgniteFsMode> pathModes;
private Map<String, IgfsMode> pathModes;

/** Maximum space. */
private long maxSpace;
Expand Down Expand Up @@ -491,12 +491,12 @@ public void setManagementPort(int mgmtPort) {
* Secondary Hadoop file system is provided for pass-through, write-through, and read-through
* purposes.
* <p>
* Default mode is {@link IgniteFsMode#DUAL_ASYNC}. If secondary Hadoop file system is
* not configured, this mode will work just like {@link IgniteFsMode#PRIMARY} mode.
* Default mode is {@link org.apache.ignite.ignitefs.IgfsMode#DUAL_ASYNC}. If secondary Hadoop file system is
* not configured, this mode will work just like {@link org.apache.ignite.ignitefs.IgfsMode#PRIMARY} mode.
*
* @return Mode to specify how GGFS interacts with secondary HDFS file system.
*/
public IgniteFsMode getDefaultMode() {
public IgfsMode getDefaultMode() {
return dfltMode;
}

Expand All @@ -507,7 +507,7 @@ public IgniteFsMode getDefaultMode() {
*
* @param dfltMode {@code GGFS} mode.
*/
public void setDefaultMode(IgniteFsMode dfltMode) {
public void setDefaultMode(IgfsMode dfltMode) {
this.dfltMode = dfltMode;
}

Expand Down Expand Up @@ -547,7 +547,7 @@ public void setSecondaryFileSystem(Igfs fileSystem) {
*
* @return Map of paths to {@code GGFS} modes.
*/
@Nullable public Map<String, IgniteFsMode> getPathModes() {
@Nullable public Map<String, IgfsMode> getPathModes() {
return pathModes;
}

Expand All @@ -559,7 +559,7 @@ public void setSecondaryFileSystem(Igfs fileSystem) {
*
* @param pathModes Map of paths to {@code GGFS} modes.
*/
public void setPathModes(Map<String, IgniteFsMode> pathModes) {
public void setPathModes(Map<String, IgfsMode> pathModes) {
this.pathModes = pathModes;
}

Expand Down
Expand Up @@ -70,7 +70,7 @@ public interface Igfs {
* @return File information for specified path or {@code null} if such path does not exist.
* @throws IgniteException In case of error.
*/
public IgniteFsFile update(IgfsPath path, Map<String, String> props) throws IgniteException;
public IgfsFile update(IgfsPath path, Map<String, String> props) throws IgniteException;

/**
* Renames/moves a file.
Expand Down Expand Up @@ -138,7 +138,7 @@ public interface Igfs {
* @throws IgniteException In case of error.
* @throws IgfsFileNotFoundException If path doesn't exist.
*/
public Collection<IgniteFsFile> listFiles(IgfsPath path) throws IgniteException;
public Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteException;

/**
* Opens a file for reading.
Expand Down Expand Up @@ -197,7 +197,7 @@ public OutputStream append(IgfsPath path, int bufSize, boolean create, @Nullable
* @return File information for specified path or {@code null} if such path does not exist.
* @throws IgniteException In case of error.
*/
public IgniteFsFile info(IgfsPath path) throws IgniteException;
public IgfsFile info(IgfsPath path) throws IgniteException;

/**
* Gets used space in bytes.
Expand Down
Expand Up @@ -24,7 +24,7 @@
* node affinity of a certain file block within the Grid by calling
* {@link org.apache.ignite.IgniteFs#affinity(IgfsPath, long, long)} method.
*/
public interface IgniteFsBlockLocation {
public interface IgfsBlockLocation {
/**
* Start position in the file this block relates to.
*
Expand Down
Expand Up @@ -21,7 +21,7 @@
* {@code GGFS} exception indicating that file system structure was modified concurrently. This error
* indicates that an operation performed in DUAL mode cannot proceed due to these changes.
*/
public class IgniteFsConcurrentModificationException extends IgniteFsException {
public class IgfsConcurrentModificationException extends IgfsException {
/** */
private static final long serialVersionUID = 0L;

Expand All @@ -30,7 +30,7 @@ public class IgniteFsConcurrentModificationException extends IgniteFsException {
*
* @param path Affected path.
*/
public IgniteFsConcurrentModificationException(IgfsPath path) {
public IgfsConcurrentModificationException(IgfsPath path) {
super("File system entry has been modified concurrently: " + path, null);
}
}
Expand Up @@ -22,29 +22,29 @@
/**
* Exception thrown when target file's block is not found in data cache.
*/
public class IgniteFsCorruptedFileException extends IgniteFsException {
public class IgfsCorruptedFileException extends IgfsException {
/** */
private static final long serialVersionUID = 0L;

/**
* @param msg Error message.
*/
public IgniteFsCorruptedFileException(String msg) {
public IgfsCorruptedFileException(String msg) {
super(msg);
}

/**
* @param cause Error cause.
*/
public IgniteFsCorruptedFileException(Throwable cause) {
public IgfsCorruptedFileException(Throwable cause) {
super(cause);
}

/**
* @param msg Error message.
* @param cause Error cause.
*/
public IgniteFsCorruptedFileException(String msg, @Nullable Throwable cause) {
public IgfsCorruptedFileException(String msg, @Nullable Throwable cause) {
super(msg, cause);
}
}
Expand Up @@ -23,7 +23,7 @@
/**
* {@code GGFS} exception thrown by file system components.
*/
public class IgniteFsException extends IgniteException {
public class IgfsException extends IgniteException {
/** */
private static final long serialVersionUID = 0L;

Expand All @@ -32,7 +32,7 @@ public class IgniteFsException extends IgniteException {
*
* @param msg Error message.
*/
public IgniteFsException(String msg) {
public IgfsException(String msg) {
super(msg);
}

Expand All @@ -41,7 +41,7 @@ public IgniteFsException(String msg) {
*
* @param cause Exception cause.
*/
public IgniteFsException(Throwable cause) {
public IgfsException(Throwable cause) {
super(cause);
}

Expand All @@ -51,7 +51,7 @@ public IgniteFsException(Throwable cause) {
* @param msg Error message.
* @param cause Exception cause.
*/
public IgniteFsException(String msg, @Nullable Throwable cause) {
public IgfsException(String msg, @Nullable Throwable cause) {
super(msg, cause);
}
}
Expand Up @@ -31,7 +31,7 @@
* GridGgfsFile file = ggfs.info(filePath);
* </pre>
*/
public interface IgniteFsFile {
public interface IgfsFile {
/**
* Gets path to file.
*
Expand Down
Expand Up @@ -20,7 +20,7 @@
/**
* {@code GGFS} exception indicating that target resource is not found.
*/
public class IgfsFileNotFoundException extends IgniteFsInvalidPathException {
public class IgfsFileNotFoundException extends IgfsInvalidPathException {
/** */
private static final long serialVersionUID = 0L;

Expand Down
Expand Up @@ -53,7 +53,7 @@
* &lt;/bean&gt;
* </pre>
*/
public class IgniteFsGroupDataBlocksKeyMapper extends GridCacheDefaultAffinityKeyMapper {
public class IgfsGroupDataBlocksKeyMapper extends GridCacheDefaultAffinityKeyMapper {
/** */
private static final long serialVersionUID = 0L;

Expand All @@ -65,7 +65,7 @@ public class IgniteFsGroupDataBlocksKeyMapper extends GridCacheDefaultAffinityKe
*
* @param grpSize Size of the group in blocks.
*/
public IgniteFsGroupDataBlocksKeyMapper(int grpSize) {
public IgfsGroupDataBlocksKeyMapper(int grpSize) {
A.ensure(grpSize >= 1, "grpSize >= 1");

this.grpSize = grpSize;
Expand Down Expand Up @@ -96,6 +96,6 @@ public int groupSize() {

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(IgniteFsGroupDataBlocksKeyMapper.class, this);
return S.toString(IgfsGroupDataBlocksKeyMapper.class, this);
}
}
Expand Up @@ -21,22 +21,22 @@
* Exception thrown when Ignite detects that remote HDFS version differs from version of HDFS libraries
* in Ignite classpath.
*/
public class IgniteFsInvalidHdfsVersionException extends IgniteFsException {
public class IgfsInvalidHdfsVersionException extends IgfsException {
/** */
private static final long serialVersionUID = 0L;

/**
* @param msg Error message.
*/
public IgniteFsInvalidHdfsVersionException(String msg) {
public IgfsInvalidHdfsVersionException(String msg) {
super(msg);
}

/**
* @param msg Error message.
* @param cause Error cause.
*/
public IgniteFsInvalidHdfsVersionException(String msg, Throwable cause) {
public IgfsInvalidHdfsVersionException(String msg, Throwable cause) {
super(msg, cause);
}
}

0 comments on commit 19c7b35

Please sign in to comment.