mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
16.56.2015 34ffc6b8a4a78ff74f12ebde68a8e87115cbcfd7
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexInputBuffer.java
@@ -85,8 +85,8 @@
   * @throws IOException
   *           If an IO error occurred when priming the cache.
   */
  public IndexInputBuffer(IndexManager indexMgr, FileChannel channel,
      long begin, long end, int bufferID, int cacheSize) throws IOException
  IndexInputBuffer(IndexManager indexMgr, FileChannel channel, long begin, long end, int bufferID, int cacheSize)
      throws IOException
  {
    this.indexMgr = indexMgr;
    this.channel = channel;
@@ -130,42 +130,17 @@
   * @throws IOException
   *           If an IO error occurred.
   */
  public boolean hasMoreData() throws IOException
  boolean hasMoreData() throws IOException
  {
    boolean hasMore = begin + offset < end;
    return cache.remaining() != 0 || hasMore;
  }
  /**
   * Returns the length of the next key.
   *
   * @return The length of the next key.
   */
  public int getKeyLen()
  {
    return keyBuffer.length();
  }
  /**
   * Fetches the next key into the provided byte string builder.
   *
   * @param b
   *          A builder where to fetch the key
   */
  public void fetchKey(ByteStringBuilder b)
  {
    b.clear().append(keyBuffer);
  }
  /**
   * Returns the index ID of the next record.
   *
   * @return The index ID of the next record.
   */
  public Integer getIndexID()
  ImportRecord currentRecord()
  {
    if (record == null)
    {
      // ensure record fetched
      try
      {
        fetchNextRecord();
@@ -176,7 +151,7 @@
        throw new RuntimeException(ex);
      }
    }
    return record != null ? record.getIndexID() : null;
    return record;
  }
  /**
@@ -186,7 +161,7 @@
   * @throws IOException
   *           If an IO error occurred.
   */
  public void fetchNextRecord() throws IOException
  void fetchNextRecord() throws IOException
  {
    switch (recordState)
    {
@@ -233,15 +208,14 @@
  }
  /**
   * Reads the next ID set from the record and merges it with the provided ID
   * set.
   * Reads the next ID set from the record and merges it with the provided ID set.
   *
   * @param idSet
   *          The ID set to be merged.
   * @throws IOException
   *           If an IO error occurred.
   */
  public void mergeIDSet(ImportIDSet idSet) throws IOException
  void mergeIDSet(ImportIDSet idSet) throws IOException
  {
    if (recordState == RecordState.START)
    {
@@ -310,18 +284,4 @@
    }
    return cmp;
  }
  ImportRecord currentRecord()
  {
    ensureRecordFetched();
    return record;
  }
  private void ensureRecordFetched()
  {
    if (keyBuffer.length() == 0)
    {
      getIndexID();
    }
  }
}