move filename for keys.csv to UniqueStringIntegerPairs
This commit is contained in:
@@ -123,7 +123,7 @@ public class DataStore implements AutoCloseable {
|
||||
public DataStore(final Path dataDirectory) throws IOException {
|
||||
storageBasePath = storageDirectory(dataDirectory);
|
||||
|
||||
stringCompressor = StringCompressor.create(keyCompressionFile(storageBasePath));
|
||||
stringCompressor = StringCompressor.create(storageBasePath);
|
||||
Tags.STRING_COMPRESSOR = stringCompressor;
|
||||
|
||||
diskStorage = new PartitionDiskStore(storageBasePath, "data.bs");
|
||||
@@ -143,10 +143,6 @@ public class DataStore implements AutoCloseable {
|
||||
writerCache.addListener((key, value) -> value.close());
|
||||
}
|
||||
|
||||
private Path keyCompressionFile(final Path dataDirectory) throws IOException {
|
||||
return dataDirectory.resolve("keys.csv");
|
||||
}
|
||||
|
||||
public static Path storageDirectory(final Path dataDirectory) throws IOException {
|
||||
return dataDirectory.resolve(SUBDIR_STORAGE);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ public class StringCompressor {
|
||||
this.usip = usip;
|
||||
}
|
||||
|
||||
public static StringCompressor create(final Path path) {
|
||||
final UniqueStringIntegerPairs mapsi = new UniqueStringIntegerPairs(path);
|
||||
public static StringCompressor create(final Path storageBasePath) {
|
||||
final UniqueStringIntegerPairs mapsi = new UniqueStringIntegerPairs(storageBasePath);
|
||||
final StringCompressor result = new StringCompressor(mapsi);
|
||||
|
||||
result.put(ALL_DOCS_KEY);
|
||||
|
||||
@@ -103,13 +103,17 @@ public class UniqueStringIntegerPairs {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public UniqueStringIntegerPairs(final Path file) {
|
||||
this.file = file;
|
||||
public UniqueStringIntegerPairs(final Path storageBasePath) {
|
||||
this.file = keyCompressionFile(storageBasePath);
|
||||
if (file != null) {
|
||||
init(file);
|
||||
}
|
||||
}
|
||||
|
||||
private Path keyCompressionFile(final Path dataDirectory) {
|
||||
return dataDirectory.resolve("keys.csv");
|
||||
}
|
||||
|
||||
private void init(final Path file) throws RuntimeIOException {
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user