krati.core.segment
Class SegmentMeta

java.lang.Object
  extended by krati.core.segment.SegmentMeta

public class SegmentMeta
extends Object

SegmentMeta: Meta Data for Segments

          PREVIOUS-SECTION CURRENT-SECTION
          
          SEGGEN  SEGLOAD  SEGGEN  SEGLOAD
 00000000    5       ?        6       ?
 00000010    0       ?        0       ?
 00000020    1       ?        0       ?
 00000030    1       ?        1       ?
 00000040    1       ?        1       ?
 00000050    0       ?        1       ?
 00000060    .       .        .       .
 

Author:
jwu

Constructor Summary
SegmentMeta(File file)
           
 
Method Summary
 int countSegmentsInService()
           
 void ensureCapacity(int segmentCount)
           
 int getCapacity()
           
 File getMetaFile()
           
 int getSegmentLoadSize(int segmentId)
           
 boolean hasSegmentInService(int segmentId)
           
 boolean lock()
           
 boolean unlock()
           
 void wrap(SegmentManager segmentManager)
          Wrap a segment manager and persist its meta data into the .meta file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SegmentMeta

public SegmentMeta(File file)
            throws IOException
Throws:
IOException
Method Detail

getMetaFile

public File getMetaFile()

lock

public boolean lock()
             throws IOException
Throws:
IOException

unlock

public boolean unlock()
               throws IOException
Throws:
IOException

countSegmentsInService

public int countSegmentsInService()

hasSegmentInService

public boolean hasSegmentInService(int segmentId)

getSegmentLoadSize

public int getSegmentLoadSize(int segmentId)

getCapacity

public int getCapacity()

ensureCapacity

public void ensureCapacity(int segmentCount)
                    throws IOException
Throws:
IOException

wrap

public void wrap(SegmentManager segmentManager)
          throws IOException
Wrap a segment manager and persist its meta data into the .meta file.

Parameters:
segmentManager - manager for segments
Throws:
IOException


Copyright © 2011. All Rights Reserved.