Search in sources :

Example 1 with IgfsFileMap

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

the class IgfsMetaFileUnlockProcessor method process.

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

Example 2 with IgfsFileMap

use of org.apache.ignite.internal.processors.igfs.IgfsFileMap 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 3 with IgfsFileMap

use of org.apache.ignite.internal.processors.igfs.IgfsFileMap 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 4 with IgfsFileMap

use of org.apache.ignite.internal.processors.igfs.IgfsFileMap 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)

Aggregations

IgfsEntryInfo (org.apache.ignite.internal.processors.igfs.IgfsEntryInfo)4 IgfsFileMap (org.apache.ignite.internal.processors.igfs.IgfsFileMap)4