Search in sources :

Example 11 with IgfsEntryInfo

use of org.apache.ignite.internal.processors.igfs.IgfsEntryInfo in project ignite by apache.

the class IgfsMetaFileRangeDeleteProcessor method process.

/** {@inheritDoc} */
@Override
public IgfsEntryInfo process(MutableEntry<IgniteUuid, IgfsEntryInfo> entry, Object... args) throws EntryProcessorException {
    IgfsEntryInfo oldInfo = entry.getValue();
    IgfsFileMap newMap = new IgfsFileMap(oldInfo.fileMap());
    newMap.deleteRange(range);
    IgfsEntryInfo newInfo = oldInfo.fileMap(newMap);
    entry.setValue(newInfo);
    return newInfo;
}
Also used : IgfsFileMap(org.apache.ignite.internal.processors.igfs.IgfsFileMap) IgfsEntryInfo(org.apache.ignite.internal.processors.igfs.IgfsEntryInfo)

Example 12 with IgfsEntryInfo

use of org.apache.ignite.internal.processors.igfs.IgfsEntryInfo in project ignite by apache.

the class IgfsMetaFileRangeUpdateProcessor method process.

/** {@inheritDoc} */
@Override
public IgfsEntryInfo process(MutableEntry<IgniteUuid, IgfsEntryInfo> entry, Object... args) throws EntryProcessorException {
    IgfsEntryInfo oldInfo = entry.getValue();
    IgfsFileMap newMap = new IgfsFileMap(oldInfo.fileMap());
    newMap.updateRangeStatus(range, status);
    IgfsEntryInfo newInfo = oldInfo.fileMap(newMap);
    entry.setValue(newInfo);
    return newInfo;
}
Also used : IgfsFileMap(org.apache.ignite.internal.processors.igfs.IgfsFileMap) IgfsEntryInfo(org.apache.ignite.internal.processors.igfs.IgfsEntryInfo)

Example 13 with IgfsEntryInfo

use of org.apache.ignite.internal.processors.igfs.IgfsEntryInfo in project ignite by apache.

the class IgfsMetaFileReserveSpaceProcessor method process.

/** {@inheritDoc} */
@Override
public IgfsEntryInfo process(MutableEntry<IgniteUuid, IgfsEntryInfo> entry, Object... args) throws EntryProcessorException {
    IgfsEntryInfo oldInfo = entry.getValue();
    IgfsFileMap newMap = new IgfsFileMap(oldInfo.fileMap());
    newMap.addRange(affRange);
    IgfsEntryInfo newInfo = oldInfo.length(oldInfo.length() + space).fileMap(newMap);
    entry.setValue(newInfo);
    return newInfo;
}
Also used : IgfsFileMap(org.apache.ignite.internal.processors.igfs.IgfsFileMap) IgfsEntryInfo(org.apache.ignite.internal.processors.igfs.IgfsEntryInfo)

Example 14 with IgfsEntryInfo

use of org.apache.ignite.internal.processors.igfs.IgfsEntryInfo in project ignite by apache.

the class IgfsMetaUpdatePropertiesProcessor method process.

/** {@inheritDoc} */
@Override
public IgfsEntryInfo process(MutableEntry<IgniteUuid, IgfsEntryInfo> entry, Object... args) throws EntryProcessorException {
    IgfsEntryInfo oldInfo = entry.getValue();
    Map<String, String> tmp = oldInfo.properties();
    tmp = tmp == null ? new GridLeanMap<String, String>(props.size()) : new GridLeanMap<>(tmp);
    for (Map.Entry<String, String> e : props.entrySet()) {
        if (e.getValue() == null)
            // Remove properties with 'null' values.
            tmp.remove(e.getKey());
        else
            // Add/overwrite property.
            tmp.put(e.getKey(), e.getValue());
    }
    IgfsEntryInfo newInfo = oldInfo.properties(tmp);
    entry.setValue(newInfo);
    return newInfo;
}
Also used : GridLeanMap(org.apache.ignite.internal.util.GridLeanMap) IgfsEntryInfo(org.apache.ignite.internal.processors.igfs.IgfsEntryInfo) Map(java.util.Map) GridLeanMap(org.apache.ignite.internal.util.GridLeanMap)

Example 15 with IgfsEntryInfo

use of org.apache.ignite.internal.processors.igfs.IgfsEntryInfo in project ignite by apache.

the class IgfsMetaUpdateTimesProcessor method process.

/** {@inheritDoc} */
@Override
public Void process(MutableEntry<IgniteUuid, IgfsEntryInfo> entry, Object... args) throws EntryProcessorException {
    IgfsEntryInfo oldInfo = entry.getValue();
    entry.setValue(oldInfo.accessModificationTime(accessTime, modificationTime));
    return null;
}
Also used : IgfsEntryInfo(org.apache.ignite.internal.processors.igfs.IgfsEntryInfo)

Aggregations

IgfsEntryInfo (org.apache.ignite.internal.processors.igfs.IgfsEntryInfo)16 HashMap (java.util.HashMap)4 IgniteException (org.apache.ignite.IgniteException)4 IgfsFileMap (org.apache.ignite.internal.processors.igfs.IgfsFileMap)4 IgfsListingEntry (org.apache.ignite.internal.processors.igfs.IgfsListingEntry)4 IOException (java.io.IOException)2 IgfsPath (org.apache.ignite.igfs.IgfsPath)2 IgfsMetaManager (org.apache.ignite.internal.processors.igfs.IgfsMetaManager)2 FileNotFoundException (java.io.FileNotFoundException)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 Configuration (org.apache.hadoop.conf.Configuration)1 FSDataInputStream (org.apache.hadoop.fs.FSDataInputStream)1 FileStatus (org.apache.hadoop.fs.FileStatus)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)1 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1