Package org.apache.ignite.internal.pagemem.wal.record

## Class DataEntry

- java.lang.Object
- - org.apache.ignite.internal.pagemem.wal.record.DataEntry

Direct Known Subclasses:
  `LazyDataEntry`, `RecordDataV1Serializer.EncryptedDataEntry`, `UnwrapDataEntry`

    public class DataEntry
    extends Object

Represents Data Entry (`key`, `value`) pair update `operation` in WAL log.

### Field Summary

Fields
`protected int` `cacheId` Cache ID.
`static byte` `EMPTY_FLAGS` Empty flags.
`protected long` `expireTime` Expire time.
`protected byte` `flags` Bit flags.
`static byte` `FROM_STORE_FLAG`
`protected KeyCacheObject` `key` Cache object key.
`protected GridCacheVersion` `nearXidVer` Near transaction version.
`protected GridCacheOperation` `op` Entry operation performed.
`protected long` `partCnt`
`protected int` `partId` Partition ID.
`static byte` `PRELOAD_FLAG`
`static byte` `PRIMARY_FLAG`
`protected @Nullable CacheObject` `val` Cache object value.
`protected GridCacheVersion` `writeVer` Write version.

### Constructor Summary

Constructors
`DataEntry​(int cacheId, KeyCacheObject key, @Nullable CacheObject val, GridCacheOperation op, GridCacheVersion nearXidVer, GridCacheVersion writeVer, long expireTime, int partId, long partCnt, byte flags)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`int` `cacheId()`
`long` `expireTime()`
`byte` `flags()` Entry flags.
`static byte` `flags​(boolean primary)`
`static byte` `flags​(boolean primary, boolean preload, boolean fromStore)`
`KeyCacheObject` `key()`
`GridCacheVersion` `nearXidVersion()`
`GridCacheOperation` `op()`
`long` `partitionCounter()`
`DataEntry` `partitionCounter​(long partCnt)` Sets partition update counter to entry.
`int` `partitionId()`
`String` `toString()`
`CacheObject` `value()`
`GridCacheVersion` `writeVersion()`

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

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

### Field Detail

#### EMPTY_FLAGS

    public static final byte EMPTY_FLAGS

Empty flags.

See Also:
  Constant Field Values

#### PRIMARY_FLAG

    public static final byte PRIMARY_FLAG

See Also:
  Constant Field Values

#### PRELOAD_FLAG

    public static final byte PRELOAD_FLAG

See Also:
  Constant Field Values

#### FROM_STORE_FLAG

    public static final byte FROM_STORE_FLAG

See Also:
  Constant Field Values

#### cacheId

    @GridToStringInclude
    protected int cacheId

Cache ID.

#### key

    protected KeyCacheObject key

Cache object key.

#### val

    @Nullable
    protected @Nullable CacheObject val

Cache object value. May be null for `GridCacheOperation.DELETE`

#### op

    @GridToStringInclude
    protected GridCacheOperation op

Entry operation performed.

#### nearXidVer

    @GridToStringInclude
    protected GridCacheVersion nearXidVer

Near transaction version.

#### writeVer

    @GridToStringInclude
    protected GridCacheVersion writeVer

Write version.

#### expireTime

    protected long expireTime

Expire time.

#### partId

    @GridToStringInclude
    protected int partId

Partition ID.

#### partCnt

    @GridToStringInclude
    protected long partCnt

#### flags

    @GridToStringInclude
    protected byte flags

Bit flags.

- 0 bit - primary - seted when current node is primary for entry partition.
- 1 bit - preload - seted when entry logged during preload(rebalance).
- 2 bit - fromStore - seted when entry loaded from third-party store.

### Constructor Detail

#### DataEntry

    public DataEntry​(int cacheId,
                     KeyCacheObject key,
                     @Nullable
                     @Nullable CacheObject val,
                     GridCacheOperation op,
                     GridCacheVersion nearXidVer,
                     GridCacheVersion writeVer,
                     long expireTime,
                     int partId,
                     long partCnt,
                     byte flags)

Parameters:
  `cacheId` - Cache ID.
  `key` - Key.
  `val` - Value or null for delete operation.
  `op` - Operation.
  `nearXidVer` - Near transaction version.
  `writeVer` - Write version.
  `expireTime` - Expire time.
  `partId` - Partition ID.
  `partCnt` - Partition counter.
  `flags` - Entry flags.

### Method Detail

#### flags

    public static byte flags​(boolean primary)

Parameters:
  `primary` - `True` if node is primary for partition in the moment of logging.
Returns:
  Flags value.

#### flags

    public static byte flags​(boolean primary,
                             boolean preload,
                             boolean fromStore)

Parameters:
  `primary` - `True` if node is primary for partition in the moment of logging.
  `preload` - `True` if logged during preload(rebalance).
  `fromStore` - `True` if logged during loading from third-party store.
Returns:
  Flags value.

#### cacheId

    public int cacheId()

Returns:
  Cache ID.

#### key

    public KeyCacheObject key()

Returns:
  Key cache object.

#### value

    public CacheObject value()

Returns:
  Value cache object.

#### op

    public GridCacheOperation op()

Returns:
  Cache operation.

#### nearXidVersion

    public GridCacheVersion nearXidVersion()

Returns:
  Near transaction version if the write was transactional.

#### writeVersion

    public GridCacheVersion writeVersion()

Returns:
  Write version.

#### partitionId

    public int partitionId()

Returns:
  Partition ID.

#### partitionCounter

    public long partitionCounter()

Returns:
  Partition counter.

#### partitionCounter

    public DataEntry partitionCounter​(long partCnt)

Sets partition update counter to entry.

Parameters:
  `partCnt` - Partition update counter.
Returns:
  `this` for chaining.

#### expireTime

    public long expireTime()

Returns:
  Expire time.

#### flags

    public byte flags()

Entry flags.

See Also:
  `flags`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`