org.apache.ignite.internal.processors.igfs

## Class IgfsEntryInfo

- java.lang.Object
- - org.apache.ignite.internal.processors.igfs.IgfsEntryInfo

All Implemented Interfaces:
  Externalizable, Serializable

Direct Known Subclasses:
  IgfsDirectoryInfo, IgfsFileInfo

    public abstract class IgfsEntryInfo
    extends Object
    implements Externalizable

Base IGFS entry.

See Also:
  Serialized Form

### Field Summary

Fields
`protected long` `accessTime` Last access time.
`protected IgniteUuid` `id` ID.
`protected long` `modificationTime` Last modification time.
`protected Map<String,String>` `props` Properties.

### Constructor Summary

Constructors
`protected` `IgfsEntryInfo()` Default constructor.
`protected` `IgfsEntryInfo(IgniteUuid id, Map<String,String> props, long accessTime, long modificationTime)` Constructor.

### Method Summary

Methods
`IgfsEntryInfo` `accessModificationTime(long accessTime, long modificationTime)` Update access and modification time.
`long` `accessTime()`
`abstract IgniteUuid` `affinityKey()`
`abstract long` `blocksCount()`
`abstract int` `blockSize()` Get single data block size to store this file.
`protected abstract IgfsEntryInfo` `copy()` Copy file info.
`abstract boolean` `evictExclude()` Get evict exclude flag.
`abstract IgfsFileMap` `fileMap()`
`abstract IgfsEntryInfo` `fileMap(IgfsFileMap fileMap)` Update file map.
`abstract boolean` `hasChild(String name)`
`abstract boolean` `hasChild(String name, IgniteUuid expId)`
`abstract boolean` `hasChildren()`
`IgniteUuid` `id()` Gets this item ID.
`boolean` `isDirectory()`
`abstract boolean` `isFile()`
`abstract long` `length()` Get file size.
`abstract IgfsEntryInfo` `length(long len)` Update length.
`abstract Map<String,IgfsListingEntry>` `listing()`
`abstract IgfsEntryInfo` `listing(Map<String,IgfsListingEntry> listing)` Update listing.
`abstract IgfsEntryInfo` `lock(IgniteUuid lockId)` Lock file.
`abstract IgniteUuid` `lockId()` Get lock ID.
`long` `modificationTime()`
`Map<String,String>` `properties()` Get properties of the file.
`IgfsEntryInfo` `properties(Map<String,String> props)` Update properties.
`protected void` `readBinary(BinaryRawReader in)` Read binary content.
`void` `readExternal(ObjectInput in)`
`String` `toString()`
`abstract IgfsEntryInfo` `unlock(long modificationTime)` Unlock file.
`protected void` `writeBinary(BinaryRawWriter out)` Write binary content.
`void` `writeExternal(ObjectOutput out)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### id

    protected IgniteUuid id

ID.

#### props

    protected Map<String,String> props

Properties.

#### accessTime

    protected long accessTime

Last access time.

#### modificationTime

    protected long modificationTime

Last modification time.

### Constructor Detail

#### IgfsEntryInfo

    protected IgfsEntryInfo()

Default constructor.

#### IgfsEntryInfo

    protected IgfsEntryInfo(IgniteUuid id,
                 @Nullable
                 Map<String,String> props,
                 long accessTime,
                 long modificationTime)

Constructor.

Parameters:
  `id` - ID.
  `props` - Properties.
  `accessTime` - Access time.
  `modificationTime` - Modification time.

### Method Detail

#### id

    public IgniteUuid id()

Gets this item ID.

Returns:
  This item ID.

#### properties

    public Map<String,String> properties()

Get properties of the file.

Returns:
  Properties of the file.

#### accessTime

    public long accessTime()

Returns:
  Last access time.

#### modificationTime

    public long modificationTime()

Returns:
  Last modification time.

#### isFile

    public abstract boolean isFile()

Returns:
  `True` if this is a file.

#### length

    public abstract IgfsEntryInfo length(long len)

Update length.

Parameters:
  `len` - New length.
Returns:
  Updated file info.

#### listing

    public abstract IgfsEntryInfo listing(@Nullable
                        Map<String,IgfsListingEntry> listing)

Update listing.

Parameters:
  `listing` - Listing.
Returns:
  Updated file info.

#### properties

    public IgfsEntryInfo properties(@Nullable
                           Map<String,String> props)

Update properties.

Parameters:
  `props` - Properties.
Returns:
  Updated file info.

#### accessModificationTime

    public IgfsEntryInfo accessModificationTime(long accessTime,
                                       long modificationTime)

Update access and modification time.

Parameters:
  `accessTime` - Access time.
  `modificationTime` - Modification time.
Returns:
  Updated file info.

#### lock

    public abstract IgfsEntryInfo lock(IgniteUuid lockId)

Lock file.

Parameters:
  `lockId` - Lock ID.
Returns:
  Update file info.

#### unlock

    public abstract IgfsEntryInfo unlock(long modificationTime)

Unlock file.

Parameters:
  `modificationTime` - Modification time.
Returns:
  Updated file info.

#### fileMap

    public abstract IgfsEntryInfo fileMap(IgfsFileMap fileMap)

Update file map.

Parameters:
  `fileMap` - File affinity map.
Returns:
  Updated file info.

#### copy

    protected abstract IgfsEntryInfo copy()

Copy file info.

Returns:
  Copy.

#### isDirectory

    public boolean isDirectory()

Returns:
  `True` if this is a directory.

#### length

    public abstract long length()

Get file size.

Returns:
  File size.

#### blockSize

    public abstract int blockSize()

Get single data block size to store this file.

Returns:
  Single data block size to store this file.

#### blocksCount

    public abstract long blocksCount()

Returns:
  Number of data blocks to store this file.

#### listing

    public abstract Map<String,IgfsListingEntry> listing()

Returns:
  Directory listing.

#### hasChildren

    public abstract boolean hasChildren()

Returns:
  `True` if at least one child exists.

#### hasChild

    public abstract boolean hasChild(String name)

Parameters:
  `name` - Child name.
Returns:
  `True` if child with such name exists.

#### hasChild

    public abstract boolean hasChild(String name,
                   IgniteUuid expId)

Parameters:
  `name` - Child name.
  `expId` - Expected child ID.
Returns:
  `True` if child with such name exists.

#### affinityKey

    @Nullable
    public abstract IgniteUuid affinityKey()

Returns:
  Affinity key used for single-node file collocation. If `null`, usual mapper procedure is used for block affinity detection.

#### fileMap

    public abstract IgfsFileMap fileMap()

Returns:
  File affinity map.

#### lockId

    @Nullable
    public abstract IgniteUuid lockId()

Get lock ID.

Returns:
  Lock ID if file is locked or `null` if file is free of locks.

#### evictExclude

    public abstract boolean evictExclude()

Get evict exclude flag.

Returns:
  Evict exclude flag.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### writeBinary

    protected void writeBinary(BinaryRawWriter out)

Write binary content.

Parameters:
  `out` - Writer.

#### readBinary

    protected void readBinary(BinaryRawReader in)

Read binary content.

Parameters:
  `in` - Reader.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017