public class ATimeMonotoneIndex extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
ATimeMonotoneIndex.IndexStartmode |
static class |
ATimeMonotoneIndex.Key |
Modifier and Type | Field and Description |
---|---|
static ATimeMonotoneIndex.IndexStartmode |
APPEND_REUSE_LAST |
protected static ATimeMonotoneIndex.Key |
AT |
protected static ATimeMonotoneIndex.Key |
DI |
protected static ATimeMonotoneIndex.Key |
DT |
static int |
ENTRY_LEN |
static ATimeMonotoneIndex.IndexStartmode |
ERASE_OLD |
static String |
IDX_FILENAME
Der Dateiname, unter dem alle Indices dieser Art gespeichert werden (der Speicherort wird später bestimmt).
|
static int |
NO_VALUE |
Constructor and Description |
---|
ATimeMonotoneIndex(int size)
Erzeugt einen neuen monoton steigenden Index.
|
ATimeMonotoneIndex(int size,
String basePath,
ATimeMonotoneIndex.IndexStartmode startmode)
Erzeugt einen neuen monoton steigenden Index.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String basePath,
long dIMin,
long dIMax,
long aTMin,
long aTMax,
long dTMin,
long dTMax,
long cID)
Fügt einen neuen Eintrag in den Buffer ein.
|
int |
capacity() |
void |
checkForAdd(String basePath,
long dIMin,
long dIMax,
long aTMin,
long aTMax,
long dTMin,
long dTMax,
long cID)
Prüft, ob dem Index ein neuer Eintrag hinzugefügt werden könnte.
|
void |
closeIndex(String basePath)
Schließt den Index und speichert alle geänderten Daten auf Platte.
|
int |
entries() |
long |
getAbsoluteATMin(String basePath)
Liefert den kleinsten Archivzeit-Minwert, der jemals in diesem Index gespeichert wird.
|
protected IndexResult |
getContainerID(String basePath,
byte[] temp,
ATimeMonotoneIndex.Key cmpKey,
long minKey,
long maxKey)
Liefert die IDs der Container, bei denen der gesuchte Key zwischen Anfang und Ende liegt.
|
IndexResult |
getContainerIDByATime(String basePath,
byte[] temp,
long minATime,
long maxATime)
Liefert die IDs der Container, deren Archivzeitspanne sich mit der angegebenen Spanne ueberschneidet.
|
long |
getCurrentATMax() |
long |
getCurrentATMin() |
long |
getCurrentCID() |
long |
getCurrentDIMax() |
long |
getCurrentDIMin() |
long |
getCurrentDTMax() |
long |
getCurrentDTMin() |
protected IndexResult |
getMinEntry(String basePath)
Liefert den kleinsten Eintrag bei Sortierung nach Archivzeit.
|
void |
resize(int newSize,
String basePath)
Verändert die Größe des RingBuffers.
|
String |
toString() |
void |
updateMax(long dIMax,
long aTMax,
long dTMax)
Aktualisiert die Maximumwerte des aktuellsten Eintrages.
|
public static final ATimeMonotoneIndex.IndexStartmode APPEND_REUSE_LAST
public static final ATimeMonotoneIndex.IndexStartmode ERASE_OLD
public static final int NO_VALUE
public static final String IDX_FILENAME
protected static final ATimeMonotoneIndex.Key DI
protected static final ATimeMonotoneIndex.Key AT
protected static final ATimeMonotoneIndex.Key DT
public static final int ENTRY_LEN
public ATimeMonotoneIndex(int size, String basePath, ATimeMonotoneIndex.IndexStartmode startmode) throws IndexException
size
- Größe des Buffers (Anzahl der Einträge)basePath
- Verzeichnis der Indexdateistartmode
- ATimeMonotoneIndex.IndexStartmode.ERASE_OLD
: alte Indexdatei loeschen, ATimeMonotoneIndex.IndexStartmode.APPEND_REUSE_LAST
: anfuegen, letzten Eintrag
weiterverwendenIndexException
public ATimeMonotoneIndex(int size)
size
- Größe des Buffers (Anzahl der Einträge). Wird mindestens auf 1 gesetzt.public void resize(int newSize, String basePath) throws IndexException
newSize
- basePath
- IndexException
public void updateMax(long dIMax, long aTMax, long dTMax) throws IndexException
dIMax
- zu setzendes Datenindex-MaximumaTMax
- zu setzendes Archivzeit-MaximumdTMax
- zu setzendes Datenzeit-MaximumIndexException
public long getCurrentCID()
public long getCurrentDIMin()
public long getCurrentDIMax()
public long getCurrentATMin()
public long getCurrentATMax()
public long getCurrentDTMin()
public long getCurrentDTMax()
public void add(String basePath, long dIMin, long dIMax, long aTMin, long aTMax, long dTMin, long dTMax, long cID) throws IndexException
basePath
- Verzeichnis der IndexdateidIMin
- Min-Wert des DatenindexdIMax
- Max-Wert des DatenindexaTMin
- Min-Wert der ArchivzeitaTMax
- Max-Wert der ArchivzeitdTMin
- Min-Wert der DatenzeitdTMax
- Max-Wert der DatenzeitcID
- Container-ID des NeueintragsIndexException
public void checkForAdd(String basePath, long dIMin, long dIMax, long aTMin, long aTMax, long dTMin, long dTMax, long cID) throws IndexException
basePath
- Verzeichnis der IndexdateidIMin
- Min-Wert des DatenindexdIMax
- Max-Wert des DatenindexaTMin
- Min-Wert der ArchivzeitaTMax
- Max-Wert der ArchivzeitdTMin
- Min-Wert der DatenzeitdTMax
- Max-Wert der DatenzeitcID
- Container-ID des NeueintragsIndexException
protected IndexResult getContainerID(String basePath, byte[] temp, ATimeMonotoneIndex.Key cmpKey, long minKey, long maxKey) throws IndexException
basePath
- Verzeichnis der Indexdateitemp
- Speicherbereich, der als Puffer dient, wenn auf die Datei zurückgegriffen werden muss.cmpKey
- minKey
- maxKey
- IndexException
public IndexResult getContainerIDByATime(String basePath, byte[] temp, long minATime, long maxATime) throws IndexException
basePath
- Verzeichnis der Indexdateitemp
- Speicherbereich, der als Puffer dient, wenn auf die Datei zurückgegriffen werden muss.minATime
- Beginn der ZeitspannemaxATime
- Ende der ZeitspanneIndexException
public long getAbsoluteATMin(String basePath) throws IndexException
basePath
- Verzeichnis, in dem die Index-Datei liegtIndexException
- Bei Zugriffsproblemen mit der IndexDateiprotected IndexResult getMinEntry(String basePath) throws IndexException
basePath
- Verzeichnis, in dem die Index-Datei liegtIndexException
- Bei Zugriffsproblemen mit der IndexDateipublic int capacity()
public int entries()
public void closeIndex(String basePath) throws IndexException
basePath
- Verzeichnis, in dem die Index-Datei liegtIndexException