Interface Segment

All Superinterfaces:
AutoCloseable, org.aksw.commons.io.util.channel.ChannelFactory<Seekable>
All Known Subinterfaces:
Block, Page
All Known Implementing Classes:
PageBase

public interface Segment extends org.aksw.commons.io.util.channel.ChannelFactory<Seekable>
A segment is a sequence of bytes with a fixed size. Channels provide access to this sequence using a linear position. Channels may maintain internal pointers corresponding to a position. This may speed up speed up relative read operations as e.g. lookup of the right bucket for consecutive reads can be skipped.
Author:
raven
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Retrieve the length of the segment For segments that are based on encoded data this method may trigger a full read.

    Methods inherited from interface AutoCloseable

    close

    Methods inherited from interface org.aksw.commons.io.util.channel.ChannelFactory

    newChannel
  • Method Details

    • length

      long length() throws IOException
      Retrieve the length of the segment For segments that are based on encoded data this method may trigger a full read. Therefore, this method should be used with care.
      Returns:
      Throws:
      IOException