| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.backends.jeb.importLDIF; |
| | |
| | | } |
| | | } |
| | | |
| | | if(includeBranches.size() == 1 && excludeBranches.size() == 0 && |
| | | if((includeBranches.size() == 1) && |
| | | excludeBranches.isEmpty() && |
| | | includeBranches.get(0).equals(baseDN)) |
| | | { |
| | | // This entire base DN is explicitly included in the import with |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Void call() throws Exception |
| | | { |
| | | for(Suffix suffix : dnSuffixMap.values()) { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Void call() throws Exception |
| | | { |
| | | for(Suffix suffix : dnSuffixMap.values()) { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Void call() throws Exception |
| | | { |
| | | try |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | void processAttribute(Index index, Entry entry, EntryID entryID, |
| | | IndexKey indexKey) throws DatabaseException, |
| | | InterruptedException |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Void call() throws Exception |
| | | { |
| | | try |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Void call() throws Exception |
| | | { |
| | | Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler()); |
| | |
| | | */ |
| | | class DNState |
| | | { |
| | | private final int DN_STATE_CACHE_SIZE = 64 * KB; |
| | | private static final int DN_STATE_CACHE_SIZE = 64 * KB; |
| | | |
| | | private ByteBuffer parentDN, lastDN; |
| | | private EntryID parentID, lastID, entryID; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Void call() throws IOException |
| | | { |
| | | long offset = 0; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Void call() throws Exception |
| | | { |
| | | if (importConfiguration != null && importConfiguration.isCancelled() |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public int compareTo(IndexManager mgr) |
| | | { |
| | | return numberOfBuffers - mgr.numberOfBuffers; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Void call() throws Exception |
| | | { |
| | | ID2Entry id2entry = entryContainer.getID2Entry(); |
| | |
| | | return this.totalEntries; |
| | | } |
| | | |
| | | @Override |
| | | public void diskLowThresholdReached(DiskSpaceMonitor monitor) { |
| | | diskFullThresholdReached(monitor); |
| | | } |
| | | |
| | | @Override |
| | | public void diskFullThresholdReached(DiskSpaceMonitor monitor) { |
| | | isCanceled = true; |
| | | Message msg = ERR_REBUILD_INDEX_LACK_DISK.get( |
| | |
| | | logError(msg); |
| | | } |
| | | |
| | | @Override |
| | | public void diskSpaceRestored(DiskSpaceMonitor monitor) { |
| | | // Do nothing |
| | | } |
| | |
| | | /** |
| | | * The action to be performed by this timer task. |
| | | */ |
| | | @Override |
| | | public void run() |
| | | { |
| | | long latestTime = System.currentTimeMillis(); |
| | |
| | | * @return {@code true} if the objects are equal, or {@code false} if they |
| | | * are not. |
| | | */ |
| | | @Override |
| | | public boolean equals(Object obj) |
| | | { |
| | | if (obj instanceof IndexKey) { |
| | |
| | | * @return The combined hash values of attribute type hash code and the |
| | | * index type hash code. |
| | | */ |
| | | @Override |
| | | public int hashCode() |
| | | { |
| | | return attributeType.hashCode() + indexType.hashCode(); |
| | |
| | | private void addDN(DatabaseEntry val, Cursor cursor, |
| | | byte[] dnBytes) throws JebException |
| | | { |
| | | int pos = 0; |
| | | byte[] bytes = val.getData(); |
| | | int pLen = PackedInteger.getWriteIntLength(dnBytes.length); |
| | | int totLen = bytes.length + (pLen + dnBytes.length); |
| | | byte[] newRec = new byte[totLen]; |
| | | System.arraycopy(bytes, 0, newRec, 0, bytes.length); |
| | | pos = bytes.length; |
| | | int pos = bytes.length; |
| | | pos = PackedInteger.writeInt(newRec, pos, dnBytes.length); |
| | | System.arraycopy(dnBytes, 0, newRec, pos, dnBytes.length); |
| | | DatabaseEntry newVal = new DatabaseEntry(newRec); |
| | |
| | | //collisions. |
| | | private boolean isDNMatched(DatabaseEntry dns, byte[] dnBytes) |
| | | { |
| | | int pos = 0, len = 0; |
| | | int pos = 0; |
| | | byte[] bytes = dns.getData(); |
| | | while(pos < dns.getData().length) |
| | | { |
| | | int pLen = PackedInteger.getReadIntLength(bytes, pos); |
| | | len = PackedInteger.readInt(bytes, pos); |
| | | int len = PackedInteger.readInt(bytes, pos); |
| | | if(indexComparator.compare(bytes, pos + pLen, len, dnBytes, |
| | | dnBytes.length) == 0) |
| | | { |
| | |
| | | * @return {@code true} if the specified DN is in the temporary DN cache, |
| | | * or {@code false} if it is not. |
| | | */ |
| | | @Override |
| | | public boolean contains(DN dn) |
| | | { |
| | | boolean dnExists = false; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void uncaughtException(Thread t, Throwable e) { |
| | | if (debugEnabled()) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void diskLowThresholdReached(DiskSpaceMonitor monitor) { |
| | | diskFullThresholdReached(monitor); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void diskFullThresholdReached(DiskSpaceMonitor monitor) { |
| | | isCanceled = true; |
| | | Message msg; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void diskSpaceRestored(DiskSpaceMonitor monitor) { |
| | | // Do nothing. |
| | | } |