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.codehaus.activemq.journal.impl
Class Segment

    java.lang.Object
      org.codehaus.activemq.journal.impl.Segment

public class Segment
extends Object

Allows read/append access to a segment of a LogFile.

Version:
  $Revision: 1.2 $

Field Summary
`static int` | `SEGMENT_HEADER_SIZE`

Constructor Summary
`Segment(File file, int initialSize, byte index)`

Method Summary
`void` | `activate(int id)`
`void` | `close()`
`void` | `force()`
`int` | `getAppendOffset()`
`RecordLocationImpl` | `getFirstRecordLocation(byte fm)`
`long` | `getFirstSequenceId()`
`int` | `getId()`
`byte` | `getIndex()`
`Mark` | `getLastMark()`
`long` | `getLastSequenceId()`
`int` | `hashCode()`
`boolean` | `isActive()`
`boolean` | `isAtAppendOffset()`
`boolean` | `isReadOnly()`
`void` | `read(byte[] answer)`
`void` | `readRecordHeader(RecordHeader seekedRecordHeader)`
`void` | `reinitialize()`
`void` | `seek(int newPos)`
`void` | `setReadOnly(boolean enable)`
`String` | `toString()`
`void` | `write(BatchedWrite write)`
`void` | `write(ByteBuffer byteBuffer)`

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

Field Detail

### SEGMENT_HEADER_SIZE

    public static final int SEGMENT_HEADER_SIZE

See Also:
  Constant Field Values

Constructor Detail

### Segment

    public Segment(File file,
                   int initialSize,
                   byte index)
            throws IOException

Method Detail

### seek

    public void seek(int newPos)
              throws IOException

  Throws:
    `IOException`

### force

    public void force()
               throws IOException

  Throws:
    `IOException`

### reinitialize

    public void reinitialize()
                      throws IOException

  Throws:
    `IOException`

### setReadOnly

    public void setReadOnly(boolean enable)
                     throws IOException

  Throws:
    `IOException`

### activate

    public void activate(int id)
                  throws IOException

  Throws:
    `IOException`

### hashCode

    public int hashCode()

### getId

    public int getId()

### isActive

    public boolean isActive()

### getFirstSequenceId

    public long getFirstSequenceId()

### getLastMark

    public Mark getLastMark()

### getLastSequenceId

    public long getLastSequenceId()

### getAppendOffset

    public int getAppendOffset()

### isAtAppendOffset

    public boolean isAtAppendOffset()
                             throws IOException

  Throws:
    `IOException`

### write

    public void write(BatchedWrite write)
               throws IOException

  Parameters:
    `write` -
  Throws:
    `IOException`

### write

    public void write(ByteBuffer byteBuffer)
               throws IOException

  Throws:
    `IOException`

### readRecordHeader

    public void readRecordHeader(RecordHeader seekedRecordHeader)
                          throws IOException

  Throws:
    `IOException`

### close

    public void close()
               throws IOException

  Throws:
    `IOException`

### read

    public void read(byte[] answer)
              throws IOException

  Throws:
    `IOException`

### isReadOnly

    public boolean isReadOnly()

  Returns:

### getIndex

    public byte getIndex()

### toString

    public String toString()

### getFirstRecordLocation

    public RecordLocationImpl getFirstRecordLocation(byte fm)

  Returns:

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 © 2004 Protique, Ltd.. All Rights Reserved.