forked from hyperledger/besu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
todo: get rocks happy remove InMemoryKeyValueStorage in favor of the adapter Signed-off-by: garyschulte <garyschulte@gmail.com>
- Loading branch information
1 parent
8241fcb
commit f78f690
Showing
20 changed files
with
433 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ava/org/hyperledger/besu/plugin/services/storage/SegmentedKeyValueStorageTransaction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright ConsenSys AG. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.hyperledger.besu.plugin.services.storage; | ||
|
||
import org.hyperledger.besu.plugin.Unstable; | ||
import org.hyperledger.besu.plugin.services.exception.StorageException; | ||
|
||
/** A transaction that can atomically commit a sequence of operations to a segmented key-value store. */ | ||
@Unstable | ||
public interface SegmentedKeyValueStorageTransaction { | ||
|
||
/** | ||
* Associates the specified value with the specified key. | ||
* | ||
* <p>If a previously value had been store against the given key, the old value is replaced by the | ||
* given value. | ||
* | ||
* @param segmentIdentifier the segment identifier | ||
* @param key the given value is to be associated with. | ||
* @param value associated with the specified key. | ||
*/ | ||
void put(SegmentIdentifier segmentIdentifier, byte[] key, byte[] value); | ||
|
||
/** | ||
* When the given key is present, the key and mapped value will be removed from storage. | ||
* | ||
* @param segmentIdentifier the segment identifier | ||
* @param key the key and mapped value that will be removed. | ||
*/ | ||
void remove(SegmentIdentifier segmentIdentifier, byte[] key); | ||
|
||
/** | ||
* Performs an atomic commit of all the operations queued in the transaction. | ||
* | ||
* @throws StorageException problem was encountered preventing the commit | ||
*/ | ||
void commit() throws StorageException; | ||
|
||
/** Reset the transaction to a state prior to any operations being queued. */ | ||
void rollback(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
.../java/org/hyperledger/besu/plugin/services/storage/SnappableSegmentedKeyValueStorage.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...in/java/org/hyperledger/besu/plugin/services/storage/SnappedSegmentedKeyValueStorage.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.