Rename WriteableStorage.create() to put() as agreed during the review of CR-6383.
| | |
| | | private final Map<TreeName, Exchange> exchanges = new HashMap<TreeName, Exchange>(); |
| | | |
| | | @Override |
| | | public void create(final TreeName treeName, final ByteSequence key, |
| | | public void put(final TreeName treeName, final ByteSequence key, |
| | | final ByteSequence value) |
| | | { |
| | | try |
| | |
| | | { |
| | | ByteString key = dnToDNKey(dn, prefixRDNComponents); |
| | | ByteString value = id.toByteString(); |
| | | txn.create(getName(), key, value); |
| | | txn.put(getName(), key, value); |
| | | } |
| | | |
| | | /** |
| | |
| | | try |
| | | { |
| | | ByteString value = codec.encodeInternal(entry, dataConfig); |
| | | txn.create(getName(), key, value); |
| | | txn.put(getName(), key, value); |
| | | } |
| | | finally |
| | | { |
| | |
| | | |
| | | public void writeToDN2ID(ImportIDSet idSet) throws DirectoryException |
| | | { |
| | | txn.create(dn2id, idSet.getKey(), entryID.toByteString()); |
| | | txn.put(dn2id, idSet.getKey(), entryID.toByteString()); |
| | | indexMgr.addTotDNCount(1); |
| | | if (parentDN != null) |
| | | { |
| | |
| | | else |
| | | { |
| | | value = importIDSet.valueToByteString(); |
| | | txn.create(getName(), key, value); |
| | | txn.put(getName(), key, value); |
| | | } |
| | | } else { |
| | | // Should never happen -- the keys should always be there. |
| | |
| | | } |
| | | value = importIdSet.valueToByteString(); |
| | | } |
| | | txn.create(getName(), key, value); |
| | | txn.put(getName(), key, value); |
| | | } |
| | | |
| | | void updateKey(WriteableStorage txn, ByteString key, EntryIDSet deletedIDs, EntryIDSet addedIDs) |
| | |
| | | @Override |
| | | public void run(WriteableStorage txn) throws Exception |
| | | { |
| | | txn.create(treeName, keyEntry, value); |
| | | txn.put(treeName, keyEntry, value); |
| | | } |
| | | }); |
| | | return true; |
| | |
| | | { |
| | | ByteString key = keyForIndex(index); |
| | | |
| | | txn.create(getName(), key, trusted ? trueBytes : falseBytes); |
| | | txn.put(getName(), key, trusted ? trueBytes : falseBytes); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void create(final TreeName name, final ByteSequence key, final ByteSequence value) |
| | | public void put(final TreeName name, final ByteSequence key, final ByteSequence value) |
| | | { |
| | | txn.create(name, key, value); |
| | | txn.put(name, key, value); |
| | | logger.trace("Storage@%s.WriteableStorage@%s.create(%s, %s, %s, %s)", |
| | | storageId(), id(), backendId, name, hex(key), hex(value)); |
| | | } |
| | |
| | | * the key. |
| | | */ |
| | | SortValuesSet splitSortValuesSet = sortValuesSet.split(newSize / 2); |
| | | txn.create(getName(), splitSortValuesSet.getKeyBytes(), splitSortValuesSet.toByteString()); // splitAfter |
| | | txn.create(getName(), sortValuesSet.getKeyBytes(), sortValuesSet.toByteString()); // after |
| | | txn.put(getName(), splitSortValuesSet.getKeyBytes(), splitSortValuesSet.toByteString()); // splitAfter |
| | | txn.put(getName(), sortValuesSet.getKeyBytes(), sortValuesSet.toByteString()); // after |
| | | |
| | | if(logger.isTraceEnabled()) |
| | | { |
| | |
| | | else |
| | | { |
| | | ByteString after = sortValuesSet.toByteString(); |
| | | txn.create(getName(), key, after); |
| | | txn.put(getName(), key, after); |
| | | } |
| | | |
| | | count.getAndAdd(newSize - oldSize); |
| | |
| | | void deleteTree(TreeName name); |
| | | |
| | | /** |
| | | * Creates a new record with the provided key and value, in the tree whose name is provided. |
| | | * If a previous record is associated to the provided key, then it will be replaced by the new record. |
| | | * Adds a record with the provided key and value, replacing any existing record having the same |
| | | * key. |
| | | * |
| | | * @param treeName |
| | | * the tree name |
| | |
| | | * @param value |
| | | * the value of the new record |
| | | */ |
| | | void create(TreeName treeName, ByteSequence key, ByteSequence value); |
| | | void put(TreeName treeName, ByteSequence key, ByteSequence value); |
| | | |
| | | /** |
| | | * Updates a record with the provided key according to the new value computed by the update function. |
| | | * Atomically adds, deletes, or replaces a record with the provided key according to the new value |
| | | * computed by the update function. |
| | | * |
| | | * @param treeName |
| | | * the tree name |