| | |
| | | * Runtime exception for problems happening during the transformation |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | public static class TransformationException extends RuntimeException |
| | | private static class TransformationException extends RuntimeException |
| | | { |
| | | private final Object originalKey; |
| | | private final Object originalValue; |
| | | |
| | | public TransformationException(Exception e, Object originalKey, Object originalValue) |
| | | private TransformationException(Exception e, Object originalKey, Object originalValue) |
| | | { |
| | | super(e); |
| | | this.originalKey = originalKey; |
| | |
| | | final class DataConfig |
| | | { |
| | | /** Indicates whether data should be compressed before writing to the storage. */ |
| | | private boolean compressed; |
| | | private final boolean compressed; |
| | | |
| | | /** The configuration to use when encoding entries in the tree. */ |
| | | private EntryEncodeConfig encodeConfig; |
| | | private final EntryEncodeConfig encodeConfig; |
| | | |
| | | /** |
| | | * Construct a new DataConfig object with the specified settings. |
| | |
| | | * @throws DirectoryException |
| | | * If an error occurs retrieving the entry |
| | | */ |
| | | Entry getEntry(ReadableTransaction txn, EntryID entryID) throws DirectoryException |
| | | private Entry getEntry(ReadableTransaction txn, EntryID entryID) throws DirectoryException |
| | | { |
| | | // Try the entry cache first. |
| | | final EntryCache<?> entryCache = getEntryCache(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param entryID The entry ID to add to an import ID set. |
| | | * @throws NullPointerException if entryID is null |
| | | */ |
| | | void addEntryID(EntryID entryID) { |
| | | addEntryID(entryID.longValue()); |
| | | } |
| | | |
| | | /** |
| | | * @param entryID The {@link EntryID} to add to an import ID set. |
| | | */ |
| | | void addEntryID(long entryID) |
| | |
| | | return new ImportRecord(key, indexID); |
| | | } |
| | | |
| | | static ImportRecord fromBufferAndIndexID(byte[] buffer, int indexID) |
| | | { |
| | | int offSet = readOffset(buffer, 0); |
| | | offSet += REC_OVERHEAD + LONG_SIZE; |
| | | int keyLength = readInt(buffer, offSet); |
| | | ByteString key = ByteString.wrap(buffer, INT_SIZE + offSet, keyLength); |
| | | return new ImportRecord(key, indexID); |
| | | } |
| | | |
| | | static ImportRecord from(ByteSequence key, int indexID) |
| | | { |
| | | return new ImportRecord(key, indexID); |
| | |
| | | */ |
| | | private final int indexID; |
| | | |
| | | public ImportRecord(ByteSequence key, int indexID) |
| | | private ImportRecord(ByteSequence key, int indexID) |
| | | { |
| | | this.key = key; |
| | | this.indexID = indexID; |
| | |
| | | createOrGetBufferedVLVIndexValues(index).deleteSortKey(sortKey); |
| | | } |
| | | |
| | | void remove(Index index, ByteString key) |
| | | { |
| | | createOrGetBufferedIndexValues(index, key); |
| | | } |
| | | |
| | | void remove(Index index, ByteString key, EntryID entryID) |
| | | { |
| | | createOrGetBufferedIndexValues(index, key).deleteEntryID(entryID); |
| | |
| | | private static final TreeName ocTreeName = new TreeName("compressed_schema", DB_NAME_OC); |
| | | |
| | | /** The storage in which the trees are held. */ |
| | | private Storage storage; |
| | | private final Storage storage; |
| | | |
| | | private final ByteStringBuilder storeAttributeWriterBuffer = new ByteStringBuilder(); |
| | | private final ASN1Writer storeAttributeWriter = ASN1.getWriter(storeAttributeWriterBuffer); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Get the backend configuration used by this root container. |
| | | * |
| | | * @return The backend configuration used by this root container. |
| | | */ |
| | | PluggableBackendCfg getConfiguration() |
| | | { |
| | | return config; |
| | | } |
| | | |
| | | /** |
| | | * Get the total number of entries in this root container. |
| | | * |
| | | * @return The number of entries in this root container |
| | |
| | | * @param operation the current operation |
| | | * @throws DirectoryException if resources are in short supply |
| | | */ |
| | | public void checkForEnoughResources(Operation operation) throws DirectoryException |
| | | void checkForEnoughResources(Operation operation) throws DirectoryException |
| | | { |
| | | StorageStatus status = storage.getStorageStatus(); |
| | | if (status.isUnusable() |