public class StringIndex extends Object implements Storable<StringIndex>
| Constructor and Description |
|---|
StringIndex(Directory dir) |
StringIndex(Directory dir,
int cacheSize)
Specify a larger cacheSize to reduce disk usage.
|
| Modifier and Type | Method and Description |
|---|---|
long |
add(Map<String,String> entryMap)
This method writes the specified key-value pairs into the storage.
|
void |
close()
This method makes sure that the underlying used resources are released.
|
void |
copyTo(StringIndex stringIndex) |
StringIndex |
create(long initBytes)
Creates the underlying storage.
|
void |
flush()
This method makes sure that the underlying data is written to the storage.
|
String |
get(long entryPointer,
String key) |
Map<String,String> |
getAll(long entryPointer) |
long |
getCapacity() |
boolean |
isClosed() |
boolean |
loadExisting() |
void |
setSegmentSize(int segments) |
public StringIndex(Directory dir)
public StringIndex(Directory dir, int cacheSize)
public StringIndex create(long initBytes)
Storablecreate in interface Storable<StringIndex>public boolean loadExisting()
loadExisting in interface Storable<StringIndex>public long add(Map<String,String> entryMap)
public void flush()
Storableflush in interface Storable<StringIndex>public void close()
Storableclose in interface Storable<StringIndex>close in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
isClosed in interface Storable<StringIndex>public void setSegmentSize(int segments)
public long getCapacity()
getCapacity in interface Storable<StringIndex>public void copyTo(StringIndex stringIndex)
Copyright © 2012–2020. All rights reserved.