From ded5a449521ff85c2a05fb6e95e7d2b5a00c2647 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Sat, 12 Oct 2013 21:48:42 +0000
Subject: [PATCH] Code cleanup: remove unused classes
---
/dev/null | 157 ----------------------------------------------------
1 files changed, 0 insertions(+), 157 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexBuilder.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexBuilder.java
deleted file mode 100644
index 3dab6a8..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexBuilder.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- */
-package org.opends.server.backends.jeb;
-
-import org.opends.server.types.Entry;
-import org.opends.server.types.DirectoryException;
-import com.sleepycat.je.DatabaseException;
-
-import java.io.IOException;
-
-/**
- * The interface that represents a index builder for the import process.
- */
-public interface IndexBuilder
-{
- /**
- * This method must be called before this object can process any
- * entries. It cleans up any temporary files left over from a
- * previous import.
- */
- void startProcessing();
-
- /**
- * Indicates that the index thread should process the provided entry.
- * @param oldEntry The existing contents of the entry, or null if this is
- * a new entry.
- * @param newEntry The new contents of the entry.
- * @param entryID The entry ID.
- * @throws com.sleepycat.je.DatabaseException If an error occurs in the JE
- * database.
- * @throws java.io.IOException If an I/O error occurs while writing an
- * intermediate file.
- * @throws DirectoryException If an error occurs while processing the entry.
- */
- void processEntry(Entry oldEntry, Entry newEntry, EntryID entryID)
- throws DatabaseException, IOException, DirectoryException;
-
- /**
- * Indicates that there will be no more updates.
- * @throws IOException If an I/O error occurs while writing an intermediate
- * file.
- */
- void stopProcessing() throws IOException;
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexIteratorAllIds.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexIteratorAllIds.java
deleted file mode 100644
index a18cf62..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexIteratorAllIds.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- */
-package org.opends.server.backends.jeb;
-
-/**
- * Implements an iterator over all the entry IDs in the backend.
- * As currently implemented, will return every entry ID ever
- * assigned, regardless of whether the entry still exists.
- */
-public class IndexIteratorAllIds extends IndexIteratorRange
-{
- /**
- * Create a new iterator over all the entry IDs in the backend.
- *
- * @param rootContainer The root container where IDs from this
- * iterator will cover.
- */
- public IndexIteratorAllIds(RootContainer rootContainer)
- {
- super(rootContainer.getLowestEntryID(), rootContainer.getHighestEntryID());
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexIteratorRange.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexIteratorRange.java
deleted file mode 100644
index afc7865..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexIteratorRange.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- */
-package org.opends.server.backends.jeb;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * Implements an iterator over a range of entry IDs.
- */
-public class IndexIteratorRange implements Iterator<EntryID>
-{
- /**
- * The upper bound of the range.
- */
- private long highID;
-
- /**
- * The current position of the iterator in the range.
- */
- private long currentID;
-
-
-
- /**
- * Constructs a range iterator from lower and upper bounds.
- *
- * @param lowID The lower bound.
- * @param highID The upper bound.
- */
- public IndexIteratorRange(long lowID, long highID)
- {
- this.currentID = lowID;
- this.highID = highID;
- }
-
-
-
- /**
- * Returns <tt>true</tt> if the iteration has more elements. (In other words,
- * returns <tt>true</tt> if <tt>next</tt> would return an element rather than
- * throwing an exception.)
- *
- * @return <tt>true</tt> if the iterator has more elements.
- */
- public boolean hasNext()
- {
- return currentID <= highID;
- }
-
-
-
- /**
- * Returns the next element in the iteration. Calling this method repeatedly
- * until the {@link #hasNext()} method returns false will return each element
- * in the underlying collection exactly once.
- *
- * @return the next element in the iteration.
- * @throws java.util.NoSuchElementException
- * iteration has no more elements.
- */
- public EntryID next() throws NoSuchElementException
- {
- if (currentID <= highID)
- {
- return new EntryID(currentID++);
- }
- else
- {
- throw new NoSuchElementException();
- }
- }
-
-
-
- /**
- * Removes from the underlying collection the last element returned by the
- * iterator (optional operation). This method can be called only once per
- * call to <tt>next</tt>. The behavior of an iterator is unspecified if the
- * underlying collection is modified while the iteration is in progress in any
- * way other than by calling this method.
- *
- * @throws UnsupportedOperationException if the <tt>remove</tt> operation is
- * not supported by this Iterator.
- */
- public void remove() throws UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexMod.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexMod.java
deleted file mode 100644
index f3f65cb..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexMod.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- */
-package org.opends.server.backends.jeb;
-
-/**
- * A modification to an attribute index, to either insert an entry ID or
- * delete an entry ID, for a given key.
- */
-public class IndexMod
-{
- /**
- * The index key to be modified.
- */
- byte[] key;
-
- /**
- * The entry ID to be inserted or deleted.
- */
- EntryID value;
-
- /**
- * Indicates whether the entry ID should be inserted or deleted.
- */
- boolean isDelete;
-
- /**
- * Create a new index modification.
- * @param key The index key to be modified.
- * @param value The entry ID to be inserted or deleted.
- * @param isDelete Indicates whether the entry ID should be inserted or
- * deleted.
- */
- public IndexMod(byte[] key, EntryID value, boolean isDelete)
- {
- this.key = key;
- this.value = value;
- this.isDelete = isDelete;
- }
-
-}
-
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexModComparator.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexModComparator.java
deleted file mode 100644
index 234f970..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexModComparator.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- */
-package org.opends.server.backends.jeb;
-
-import java.util.Comparator;
-
-/**
- * A comparator for index modifications.
- */
-public class IndexModComparator implements Comparator<IndexMod>
-{
- /**
- * The index key comparator.
- */
- private Comparator<byte[]> comparator;
-
- /**
- * Indicates when true that the entry ID should also factor into the
- * comparison, in addition to the index key.
- */
- private boolean compareID;
-
- /**
- * Create a new comparator for index modifications.
- * @param comparator The index key comparator.
- * @param compareID Indicates when true that the entry ID should also factor
- * into the comparison, in addition to the index key.
- */
- public IndexModComparator(Comparator<byte[]> comparator, boolean compareID)
- {
- this.comparator = comparator;
- this.compareID = compareID;
- }
-
- /**
- * Compares its two arguments for order. Returns a negative integer,
- * zero, or a positive integer as the first argument is less than, equal
- * to, or greater than the second.
- *
- * @param a the first object to be compared.
- * @param b the second object to be compared.
- * @return a negative integer, zero, or a positive integer as the
- * first argument is less than, equal to, or greater than the
- * second.
- */
- public int compare(IndexMod a, IndexMod b)
- {
- int r = comparator.compare(a.key, b.key);
- if (compareID)
- {
- if (r == 0)
- {
- r = a.value.compareTo(b.value);
- }
- }
- return r;
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/Longs.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/Longs.java
deleted file mode 100644
index 992cf0e..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/Longs.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- */
-package org.opends.server.backends.jeb;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-
-
-/**
- * This class represents a sorted set of longs. Internally it uses an array
- * that can grow when necessary. A goal of this class is to avoid memory
- * allocations where possible.
- */
-public class Longs
-{
- /**
- * The internal array where elements are stored.
- */
- private long[] array = null;
-
-
- /**
- * The number of valid elements in the array.
- */
- private int count = 0;
-
-
-
- /**
- * Construct a new empty set.
- */
- public Longs()
- {
- }
-
-
-
- /**
- * Decodes a set from a byte array.
- * @param bytes The encoded value.
- */
- void decode(byte[] bytes)
- {
- if (bytes == null)
- {
- count = 0;
- return;
- }
-
- int count = bytes.length / 8;
- resize(count);
-
- for (int pos = 0, i = 0; i < count; i++)
- {
- long v = 0;
- v |= (bytes[pos++] & 0xFFL) << 56;
- v |= (bytes[pos++] & 0xFFL) << 48;
- v |= (bytes[pos++] & 0xFFL) << 40;
- v |= (bytes[pos++] & 0xFFL) << 32;
- v |= (bytes[pos++] & 0xFFL) << 24;
- v |= (bytes[pos++] & 0xFFL) << 16;
- v |= (bytes[pos++] & 0xFFL) << 8;
- v |= (bytes[pos++] & 0xFFL);
- array[i] = v;
- }
- this.count = count;
- }
-
-
-
- /**
- * Get the number of bytes needed to encode this value into a byte array.
- * @return The number of bytes needed to encode this value into a byte array.
- */
- public int encodedSize()
- {
- return count*8;
- }
-
-
-
- /**
- * Encode this value into a byte array.
- * @param bytes The array into which the value will be encoded. If the
- * provided array is null, or is not big enough, a new array will be
- * allocated.
- * @return The encoded array. If the provided array was bigger than needed
- * to encode the value then the provided array is returned and the number
- * of bytes of useful data is given by the encodedSize method.
- */
- byte[] encode(byte[] bytes)
- {
- int encodedSize = encodedSize();
- if (bytes == null || bytes.length < encodedSize)
- {
- bytes = new byte[encodedSize];
- }
-
- for (int pos = 0, i = 0; i < count; i++)
- {
- long v = array[i];
- bytes[pos++] = (byte) ((v >>> 56) & 0xFF);
- bytes[pos++] = (byte) ((v >>> 48) & 0xFF);
- bytes[pos++] = (byte) ((v >>> 40) & 0xFF);
- bytes[pos++] = (byte) ((v >>> 32) & 0xFF);
- bytes[pos++] = (byte) ((v >>> 24) & 0xFF);
- bytes[pos++] = (byte) ((v >>> 16) & 0xFF);
- bytes[pos++] = (byte) ((v >>> 8) & 0xFF);
- bytes[pos++] = (byte) (v & 0xFF);
- }
-
- return bytes;
- }
-
-
-
- /**
- * This is very much like Arrays.binarySearch except that it searches only
- * an initial portion of the provided array.
- * @param a The array to be searched.
- * @param count The number of initial elements in the array to be searched.
- * @param key The element to search for.
- * @return See Arrays.binarySearch.
- */
- private static int binarySearch(long[] a, int count, long key)
- {
- int low = 0;
- int high = count-1;
-
- while (low <= high)
- {
- int mid = (low + high) >> 1;
- long midVal = a[mid];
-
- if (midVal < key)
- low = mid + 1;
- else if (midVal > key)
- high = mid - 1;
- else
- return mid; // key found
- }
- return -(low + 1); // key not found.
- }
-
-
-
- /**
- * Add a new value to the set.
- * @param v The value to be added.
- * @return true if the value was added, false if it was already present
- * in the set.
- */
- public boolean add(long v)
- {
- resize(count+1);
-
- if (count == 0 || v > array[count-1])
- {
- array[count++] = v;
- return true;
- }
-
- int pos = binarySearch(array, count, v);
- if (pos >=0)
- {
- return false;
- }
-
- // For a negative return value r, the index -(r+1) gives the array
- // index at which the specified value can be inserted to maintain
- // the sorted order of the array.
- pos = -(pos+1);
-
- System.arraycopy(array, pos, array, pos+1, count-pos);
- array[pos] = v;
- count++;
- return true;
- }
-
- /**
- * Adds all the elements of a provided set to this set if they are not
- * already present.
- * @param that The set of elements to be added.
- */
- public void addAll(Longs that)
- {
- resize(this.count+that.count);
-
- if (that.count == 0)
- {
- return;
- }
-
- // Optimize for the case where the two sets are sure to have no overlap.
- if (this.count == 0 || that.array[0] > this.array[this.count-1])
- {
- System.arraycopy(that.array, 0, this.array, this.count, that.count);
- count += that.count;
- return;
- }
-
- if (this.array[0] > that.array[that.count-1])
- {
- System.arraycopy(this.array, 0, this.array, that.count, this.count);
- System.arraycopy(that.array, 0, this.array, 0, that.count);
- count += that.count;
- return;
- }
-
- int destPos = binarySearch(this.array, this.count, that.array[0]);
- if (destPos < 0)
- {
- destPos = -(destPos+1);
- }
-
- // Make space for the copy.
- int aCount = this.count - destPos;
- int aPos = destPos + that.count;
- int aEnd = aPos + aCount;
- System.arraycopy(this.array, destPos, this.array, aPos, aCount);
-
- // Optimize for the case where there is no overlap.
- if (this.array[aPos] > that.array[that.count-1])
- {
- System.arraycopy(that.array, 0, this.array, destPos, that.count);
- count += that.count;
- return;
- }
-
- int bPos;
- for ( bPos = 0; aPos < aEnd && bPos < that.count; )
- {
- if ( this.array[aPos] < that.array[bPos] )
- {
- this.array[destPos++] = this.array[aPos++];
- }
- else if ( this.array[aPos] > that.array[bPos] )
- {
- this.array[destPos++] = that.array[bPos++];
- }
- else
- {
- this.array[destPos++] = this.array[aPos++];
- bPos++;
- }
- }
-
- // Copy any remainder.
- int aRemain = aEnd - aPos;
- if (aRemain > 0)
- {
- System.arraycopy(this.array, aPos, this.array, destPos, aRemain);
- destPos += aRemain;
- }
-
- int bRemain = that.count - bPos;
- if (bRemain > 0)
- {
- System.arraycopy(that.array, bPos, this.array, destPos, bRemain);
- destPos += bRemain;
- }
-
- count = destPos;
- }
-
-
- /**
- * Deletes all the elements of a provided set from this set if they are
- * present.
- * @param that The set of elements to be deleted.
- */
- public void deleteAll(Longs that)
- {
- int thisPos, thatPos, destPos;
- for ( destPos = 0, thisPos = 0, thatPos = 0;
- thisPos < count && thatPos < that.count; )
- {
- if ( array[thisPos] < that.array[thatPos] )
- {
- array[destPos++] = array[thisPos++];
- }
- else if ( array[thisPos] > that.array[thatPos] )
- {
- thatPos++;
- }
- else
- {
- thisPos++;
- thatPos++;
- }
- }
-
- System.arraycopy(array, thisPos, array, destPos, count - thisPos);
- destPos += count - thisPos;
-
- count = destPos;
- }
-
-
- /**
- * Return the number of elements in the set.
- * @return The number of elements in the set.
- */
- public int size()
- {
- return count;
- }
-
-
- /**
- * Decode a value from a data input stream.
- * @param dataInputStream The data input stream to read the value from.
- * @throws IOException If an I/O error occurs while reading the value.
- */
- public void decode(DataInputStream dataInputStream)
- throws IOException
- {
- int len = dataInputStream.readInt();
- int count = len/8;
- resize(count);
- for (int i = 0; i < count; i++)
- {
- array[i] = dataInputStream.readLong();
- }
- this.count = count;
- }
-
-
- /**
- * Ensures capacity of the internal array for a given number of elements.
- * @param size The internal array will be guaranteed to be at least this
- * size.
- */
- private void resize(int size)
- {
- if (array == null)
- {
- array = new long[size];
- }
- else if (array.length < size)
- {
- // Expand the size of the array in powers of two.
- int newSize = array.length == 0 ? 1 : array.length;
- do
- {
- newSize *= 2;
- } while (newSize < size);
-
- long[] newBytes = new long[newSize];
- System.arraycopy(array, 0, newBytes, 0, count);
- array = newBytes;
- }
- }
-
-
- /**
- * Clears the set leaving it empty.
- */
- public void clear()
- {
- count = 0;
- }
-
-
-
- /**
- * Convert the set to a new array of longs.
- * @return An array of longs.
- */
- public long[] toArray()
- {
- long[] dst = new long[count];
-
- System.arraycopy(array, 0, dst, 0, count);
- return dst;
- }
-
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString()
- {
- StringBuilder b = new StringBuilder();
- b.append(count);
- if (count > 0)
- {
- b.append('[');
- b.append(array[0]);
- if (count > 1)
- {
- b.append(':');
- b.append(array[count-1]);
- }
- b.append(']');
- }
- return b.toString();
- }
-
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/MergeReader.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/MergeReader.java
deleted file mode 100644
index 16c43fb..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/MergeReader.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- */
-package org.opends.server.backends.jeb;
-
-import java.io.DataInputStream;
-
-/**
- * This class represents a reader of an intermediate file created
- * during an import process, and whose contents are to be merged with
- * other intermediate files.
- */
-public class MergeReader
-{
- // Data values for this reader, so we don't have to allocate a new one
- // each time we read the file.
- Longs addData;
- Longs delData;
-
-
- /**
- * The data input for this file.
- */
- DataInputStream dataInputStream;
-
-
-
- /**
- * Construct a new merge reader.
- *
- * @param dataInputStream The data input for this reader.
- */
- public MergeReader(DataInputStream dataInputStream)
- {
- addData = new Longs();
- delData = new Longs();
- this.dataInputStream = dataInputStream;
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/MergeValue.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/MergeValue.java
deleted file mode 100644
index 93823d8..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/MergeValue.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- */
-package org.opends.server.backends.jeb;
-
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.List;
-
-/**
- * This is a class used by the index merge thread. It merges the data
- * for one index key from multiple intermediate files.
- */
-public class MergeValue
-{
- /**
- * The value of the index key.
- */
- byte[] key;
-
- /**
- * The entry IDs to be added, where each set comes from a different file.
- */
- List<Longs> addData;
-
- /**
- * The entry IDs to be deleted, where each set comes from a different file.
- */
- ArrayList<Longs> delData;
-
- /**
- * A bit set indicating which files have contributed data for this key.
- * Each file reader is identified by an array index. If bit n is set,
- * it means that the reader with index n contributed data.
- */
- BitSet readers;
-
- /**
- * The index entry limit.
- */
- int entryLimit;
-
- /**
- * Create a new merge value.
- * @param numReaders The total number of file readers that could be
- * contributing to this value. Reader identifiers are in the range
- * 0 .. numReaders-1.
- * @param entryLimit The configured index entry limit.
- */
- public MergeValue(int numReaders, int entryLimit)
- {
- this.key = null;
- addData = new ArrayList<Longs>(numReaders);
- delData = new ArrayList<Longs>(numReaders);
- readers = new BitSet(numReaders);
- this.entryLimit = entryLimit;
- }
-
-
- /**
- * Get the value of the key.
- * @return The key value.
- */
- public byte[] getKey()
- {
- return key;
- }
-
-
- /**
- * Set the value of the key.
- * @param key The key value .
- */
- public void setKey(byte[] key)
- {
- this.key = key;
- }
-
-
-
- /**
- * Provide data for the key from one of the file readers.
- * @param reader The reader providing the data.
- * @param addData A set of entry IDs to be added.
- * @param delData A set of entry IDs to be deleted.
- */
- public void mergeData(int reader, Longs addData, Longs delData)
- {
- this.addData.add(addData);
- if (delData.size() > 0)
- {
- this.delData.add(delData);
- }
- readers.set(reader);
- }
-
-
- /**
- * Get the readers that provided data to be merged.
- * @return An array of identifiers of readers that provided data.
- */
- public int[] getReaders()
- {
- int[] ret = new int[readers.cardinality()];
-
- for (int i = readers.nextSetBit(0), j = 0; i != -1;
- i = readers.nextSetBit(i+1))
- {
- ret[j++] = i;
- }
- return ret;
- }
-
-
- /**
- * Get the list of arrays of IDs to be added.
- * @return The list of arrays of IDs to be added.
- */
- public List<Longs> getAddValues()
- {
- return addData;
- }
-
-
- /**
- * Get the list of arrays of IDs to be deleted.
- * @return The list of arrays of IDs to be deleted.
- */
- public List<Longs> getDelValues()
- {
- return delData;
- }
-
-}
--
Gitblit v1.10.0