org.apache.ignite.internal.igfs.common

## Class IgfsLogger

- java.lang.Object
- - org.apache.ignite.internal.igfs.common.IgfsLogger

    public final class IgfsLogger
    extends Object

IGFS client logger writing data to the file.

### Field Summary

Fields
`static String` `DELIM_FIELD` Field delimiter.
`static String` `DELIM_FIELD_VAL` Field values delimiter.
`static String` `HDR` Pre-defined header string.
`static int` `TYPE_CLOSE_IN` Close input stream.
`static int` `TYPE_CLOSE_OUT` Close output stream.
`static int` `TYPE_DELETE` Delete.
`static int` `TYPE_DIR_LIST` Directory listing.
`static int` `TYPE_DIR_MAKE` Directory creation.
`static int` `TYPE_MARK` Mark.
`static int` `TYPE_OPEN_IN` File open.
`static int` `TYPE_OPEN_OUT` File create or append.
`static int` `TYPE_RANDOM_READ` Random read.
`static int` `TYPE_RENAME` Rename.
`static int` `TYPE_RESET` Reset.
`static int` `TYPE_SEEK` Seek.
`static int` `TYPE_SKIP` Skip.

### Method Summary

Methods
`void` `close()` Close logger.
`static IgfsLogger` `disabledLogger()` Get disabled logger.
`boolean` `isLogEnabled()` Check whether logging is enabled.
`void` `logAppend(long streamId, IgfsPath path, int bufSize)` Log file append event.
`void` `logCloseIn(long streamId, long userTime, long readTime, long total)` Log input stream close event.
`void` `logCloseOut(long streamId, long userTime, long writeTime, long total)` Log output stream close event.
`void` `logCreate(long streamId, IgfsPath path, boolean overwrite, int bufSize, int replication, long blockSize)` Log file create event.
`void` `logDelete(IgfsPath path, boolean recursive)` Log delete event.
`static IgfsLogger` `logger(String endpoint, String igfsName, String dir, int batchSize)` Get logger instance for the given endpoint.
`void` `logListDirectory(IgfsPath path, String[] files)` Log directory listing event.
`void` `logMakeDirectory(IgfsPath path)` Log directory creation event.
`void` `logMark(long streamId, long readLimit)` Log mark event.
`void` `logOpen(long streamId, IgfsPath path, int bufSize, long dataLen)` Log file open event.
`void` `logRandomRead(long streamId, long pos, int readLen)` Log random read event.
`void` `logRename(IgfsPath path, IgfsPath destPath)` Log rename event.
`void` `logReset(long streamId)` Log reset event.
`void` `logSeek(long streamId, long pos)` Log seek event.
`void` `logSkip(long streamId, long skipCnt)` Log skip event.
`static long` `nextId()` Get next stream ID.

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

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

### Field Detail

#### DELIM_FIELD

    public static final String DELIM_FIELD

Field delimiter.

See Also:
  Constant Field Values

#### DELIM_FIELD_VAL

    public static final String DELIM_FIELD_VAL

Field values delimiter.

See Also:
  Constant Field Values

#### HDR

    public static final String HDR

Pre-defined header string.

See Also:
  Constant Field Values

#### TYPE_OPEN_IN

    public static final int TYPE_OPEN_IN

File open.

See Also:
  Constant Field Values

#### TYPE_OPEN_OUT

    public static final int TYPE_OPEN_OUT

File create or append.

See Also:
  Constant Field Values

#### TYPE_RANDOM_READ

    public static final int TYPE_RANDOM_READ

Random read.

See Also:
  Constant Field Values

#### TYPE_SEEK

    public static final int TYPE_SEEK

Seek.

See Also:
  Constant Field Values

#### TYPE_SKIP

    public static final int TYPE_SKIP

Skip.

See Also:
  Constant Field Values

#### TYPE_MARK

    public static final int TYPE_MARK

Mark.

See Also:
  Constant Field Values

#### TYPE_RESET

    public static final int TYPE_RESET

Reset.

See Also:
  Constant Field Values

#### TYPE_CLOSE_IN

    public static final int TYPE_CLOSE_IN

Close input stream.

See Also:
  Constant Field Values

#### TYPE_CLOSE_OUT

    public static final int TYPE_CLOSE_OUT

Close output stream.

See Also:
  Constant Field Values

#### TYPE_DIR_MAKE

    public static final int TYPE_DIR_MAKE

Directory creation.

See Also:
  Constant Field Values

#### TYPE_DIR_LIST

    public static final int TYPE_DIR_LIST

Directory listing.

See Also:
  Constant Field Values

#### TYPE_RENAME

    public static final int TYPE_RENAME

Rename.

See Also:
  Constant Field Values

#### TYPE_DELETE

    public static final int TYPE_DELETE

Delete.

See Also:
  Constant Field Values

### Method Detail

#### nextId

    public static long nextId()

Get next stream ID.

Returns:
  Stream ID.

#### disabledLogger

    public static IgfsLogger disabledLogger()

Get disabled logger.

Returns:
  Disable logger instance.

#### logger

    public static IgfsLogger logger(String endpoint,
                    String igfsName,
                    String dir,
                    int batchSize)

Get logger instance for the given endpoint.

Parameters:
  `endpoint` - Endpoint.
  `igfsName` - IGFS name.
  `dir` - Path.
  `batchSize` - Batch size.
Returns:
  Logger instance.

#### isLogEnabled

    public boolean isLogEnabled()

Check whether logging is enabled.

Returns:
  `True` in case logging is enabled.

#### logOpen

    public void logOpen(long streamId,
               IgfsPath path,
               int bufSize,
               long dataLen)

Log file open event.

Parameters:
  `streamId` - Stream ID.
  `path` - Path.
  `bufSize` - Buffer size.
  `dataLen` - Data length.

#### logCreate

    public void logCreate(long streamId,
                 IgfsPath path,
                 boolean overwrite,
                 int bufSize,
                 int replication,
                 long blockSize)

Log file create event.

Parameters:
  `streamId` - Stream ID.
  `path` - Path.
  `overwrite` - Overwrite flag.
  `bufSize` - Buffer size.
  `replication` - Replication factor.
  `blockSize` - Block size.

#### logAppend

    public void logAppend(long streamId,
                 IgfsPath path,
                 int bufSize)

Log file append event.

Parameters:
  `streamId` - Stream ID.
  `path` - Path.
  `bufSize` - Buffer size.

#### logRandomRead

    public void logRandomRead(long streamId,
                     long pos,
                     int readLen)

Log random read event.

Parameters:
  `streamId` - Stream ID.
  `pos` - Position.
  `readLen` - Read bytes count.

#### logSeek

    public void logSeek(long streamId,
               long pos)

Log seek event.

Parameters:
  `streamId` - Stream ID.
  `pos` - Position.

#### logSkip

    public void logSkip(long streamId,
               long skipCnt)

Log skip event.

Parameters:
  `streamId` - Stream ID.
  `skipCnt` - Skip bytes count.

#### logMark

    public void logMark(long streamId,
               long readLimit)

Log mark event.

Parameters:
  `streamId` - Stream ID.
  `readLimit` - Read limit.

#### logReset

    public void logReset(long streamId)

Log reset event.

Parameters:
  `streamId` - Stream ID.

#### logCloseIn

    public void logCloseIn(long streamId,
                  long userTime,
                  long readTime,
                  long total)

Log input stream close event.

Parameters:
  `streamId` - Stream ID.
  `userTime` - User time.
  `readTime` - Read time.
  `total` - Total bytes read.

#### logCloseOut

    public void logCloseOut(long streamId,
                   long userTime,
                   long writeTime,
                   long total)

Log output stream close event.

Parameters:
  `streamId` - Stream ID.
  `userTime` - User time.
  `writeTime` - Read time.
  `total` - Total bytes read.

#### logMakeDirectory

    public void logMakeDirectory(IgfsPath path)

Log directory creation event.

Parameters:
  `path` - Path.

#### logListDirectory

    public void logListDirectory(IgfsPath path,
                        String[] files)

Log directory listing event.

Parameters:
  `path` - Path.
  `files` - Files.

#### logRename

    public void logRename(IgfsPath path,
                 IgfsPath destPath)

Log rename event.

Parameters:
  `path` - Path.
  `destPath` - Destination path.

#### logDelete

    public void logDelete(IgfsPath path,
                 boolean recursive)

Log delete event.

Parameters:
  `path` - Path.
  `recursive` - Recursive flag.

#### close

    public void close()

Close logger.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017