-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DataSourceArray can no longer be accessed outside the db module:
- Knowledge of the sizeKey is removed from external tests. - Internal module tests check for correct storage of the size key in exceptional error cases that may cause it to miss from the database. - Removed the use of Flushable interface which will be removed once all implementations are updated.
- Loading branch information
1 parent
4a36af3
commit aace86d
Showing
8 changed files
with
250 additions
and
145 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.aion.db.store; | ||
|
||
import java.io.Closeable; | ||
|
||
/** | ||
* A key value store that interacts with objects that are serialized to byte arrays and deserialized | ||
* back into objects using a specified {@link Serializer} implementation. The stored data is | ||
* interpreted as an array allowing access according to the defined {@code long} index values. The | ||
* elements of the array are indexed from 0 to highest stored index value. | ||
* | ||
* @param <V> the class of objects used by a specific implementation | ||
* @author Alexandra Roatis | ||
*/ | ||
public interface ArrayStore<V> extends Closeable { | ||
|
||
/** Inserts an object at the specified index. */ | ||
void set(long index, V value); | ||
|
||
/** Removes the object at the given index. */ | ||
void remove(long index); | ||
|
||
/** Pushes changes to the underlying database. */ | ||
void commit(); | ||
|
||
/** Retrieves the object stored at the given index. */ | ||
V get(long index); | ||
|
||
/** Retrieves the size of the array defined as the highest stored entry plus one. */ | ||
long size(); | ||
|
||
/** Returns {@code true} to indicate that the database is open, {@code false} otherwise. */ | ||
boolean isOpen(); | ||
} |
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.