| | |
| | | import java.util.concurrent.BlockingQueue; |
| | | import java.util.concurrent.TimeoutException; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.zip.CheckedOutputStream; |
| | | import java.util.zip.DataFormatException; |
| | | |
| | | import org.opends.messages.Message; |
| | |
| | | { |
| | | long genID = 0; |
| | | Backend backend = retrievesBackend(this.baseDn); |
| | | long bec = backend.numSubordinates(baseDn, true) + 1; |
| | | long entryCount = (bec<1000?bec:1000); |
| | | long numberOfEntries = backend.numSubordinates(baseDn, true) + 1; |
| | | long entryCount = ( (numberOfEntries < 1000 )? numberOfEntries : 1000); |
| | | |
| | | // Acquire a shared lock for the backend. |
| | | try |
| | |
| | | ResultCode.OTHER, message, null); |
| | | } |
| | | |
| | | OutputStream os; |
| | | OutputStream os = null; |
| | | ReplLDIFOutputStream ros = null; |
| | | |
| | | if (checksumOutput) |
| | | { |
| | | ros = new ReplLDIFOutputStream(this, entryCount); |
| | | os = new CheckedOutputStream(ros, new GenerationIdChecksum()); |
| | | os = (OutputStream)new ReplLDIFOutputStream(entryCount); |
| | | ros = (ReplLDIFOutputStream)os; |
| | | try |
| | | { |
| | | os.write((Long.toString(backend.numSubordinates(baseDn, true) + 1)). |
| | | os.write((Long.toString(numberOfEntries)). |
| | | getBytes()); |
| | | } |
| | | catch(Exception e) |
| | |
| | | |
| | | if (checksumOutput) |
| | | { |
| | | genID = |
| | | ((CheckedOutputStream)os).getChecksum().getValue(); |
| | | genID = ros.getChecksumValue(); |
| | | } |
| | | |
| | | // Release the shared lock on the backend. |