Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.activeio.journal.active
Class LogFileManager

    java.lang.Object
      org.activeio.journal.active.LogFileManager

public final class LogFileManager
extends java.lang.Object

Provides a logical view of many seperate files as one single long log file. The seperate files that compose the LogFile are Segements of the LogFile.

This class is not thread safe.

Version:
  $Revision: 1.1 $

Field Summary
`static byte` | `DATA_RECORD_TYPE`
`static int` | `DEFAULT_LOGFILE_COUNT`
`static int` | `DEFAULT_LOGFILE_SIZE`
`static byte` | `MARK_RECORD_TYPE`
`static int` | `SERIALIZED_SIZE`

Constructor Summary
`LogFileManager(java.io.File logDirectory)`
`LogFileManager(java.io.File logDirectory, int onlineLogFileCount, int initialLogFileSize)`

Method Summary
`(package private) void` | `activateNextLogFile()`
`void` | `append(BatchedWrite write)`
`boolean` | `canActivateNextLogFile()`
`void` | `dispose()`
`Location` | `getFirstActiveLogLocation()`
`Location` | `getFirstRecordLocationOfSecondActiveLogFile()`
`int` | `getInitialLogFileSize()`
`Location` | `getLastMarkedRecordLocation()`
`java.io.File` | `getLogDirectory()`
`(package private) LogFileNode` | `getLogFileWithId(int logFileId)`
`Location` | `getNextAppendLocation()`
`Location` | `getNextDataRecordLocation(Location lastLocation)`
`int` | `getOnlineLogFileCount()`
`(package private) void` | `initialize(int onlineLogFileCount)`
`boolean` | `isPastHalfActive()`
`Packet` | `readPacket(Location location)`
`(package private) RecordInfo` | `readRecordInfo(Location location)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_LOGFILE_COUNT

    public static final int DEFAULT_LOGFILE_COUNT

### DEFAULT_LOGFILE_SIZE

    public static final int DEFAULT_LOGFILE_SIZE

### SERIALIZED_SIZE

    public static final int SERIALIZED_SIZE

See Also:
  Constant Field Values

### DATA_RECORD_TYPE

    public static final byte DATA_RECORD_TYPE

See Also:
  Constant Field Values

### MARK_RECORD_TYPE

    public static final byte MARK_RECORD_TYPE

See Also:
  Constant Field Values

Constructor Detail

### LogFileManager

    public LogFileManager(java.io.File logDirectory)
                   throws java.io.IOException

### LogFileManager

    public LogFileManager(java.io.File logDirectory,
                          int onlineLogFileCount,
                          int initialLogFileSize)
                   throws java.io.IOException

Method Detail

### initialize

    void initialize(int onlineLogFileCount)
              throws java.io.IOException

  Throws:
    `java.io.IOException`

### dispose

    public void dispose()

### append

    public void append(BatchedWrite write)
                throws java.io.IOException

  Parameters:
    `write` -
  Throws:
    `java.io.IOException`

### readRecordInfo

    RecordInfo readRecordInfo(Location location)
                        throws java.io.IOException,
                               InvalidRecordLocationException

  Throws:
    `java.io.IOException`
    `InvalidRecordLocationException`

### getLogFileWithId

    LogFileNode getLogFileWithId(int logFileId)
                           throws InvalidRecordLocationException

  Throws:
    `InvalidRecordLocationException`

### getNextDataRecordLocation

    public Location getNextDataRecordLocation(Location lastLocation)
                                       throws java.io.IOException,
                                              InvalidRecordLocationException

  Parameters:
    `lastLocation` -
  Returns:
  Throws:
    `java.io.IOException`
    `InvalidRecordLocationException`

### readPacket

    public Packet readPacket(Location location)
                      throws java.io.IOException,
                             InvalidRecordLocationException

  Returns:
  Throws:
    `java.io.IOException`
    `InvalidRecordLocationException`

### getInitialLogFileSize

    public int getInitialLogFileSize()

### getFirstActiveLogLocation

    public Location getFirstActiveLogLocation()

### activateNextLogFile

    void activateNextLogFile()
                       throws java.io.IOException

  Throws:
    `java.io.IOException`

### getLogDirectory

    public java.io.File getLogDirectory()

  Returns:
    Returns the logDirectory.

### getLastMarkedRecordLocation

    public Location getLastMarkedRecordLocation()

  Returns:
    Returns the lastMark.

### getNextAppendLocation

    public Location getNextAppendLocation()

### getOnlineLogFileCount

    public int getOnlineLogFileCount()

  Returns:
    Returns the onlineLogFileCount.

### isPastHalfActive

    public boolean isPastHalfActive()

### getFirstRecordLocationOfSecondActiveLogFile

    public Location getFirstRecordLocationOfSecondActiveLogFile()

### canActivateNextLogFile

    public boolean canActivateNextLogFile()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © -2005 The ActiveIO Project. All Rights Reserved.