|
|
|
|
@@ -57,11 +57,11 @@ public class DataStoreTest {
|
|
|
|
|
|
|
|
|
|
dataStore = new DataStore(dataDirectory);
|
|
|
|
|
|
|
|
|
|
final Tags eagleTim = Tags.create("bird", "eagle", "name", "Tim");
|
|
|
|
|
final Tags pigeonJennifer = Tags.create("bird", "pigeon", "name", "Jennifer");
|
|
|
|
|
final Tags flamingoJennifer = Tags.create("bird", "flamingo", "name", "Jennifer");
|
|
|
|
|
final Tags labradorJenny = Tags.create("dog", "labrador", "name", "Jenny");
|
|
|
|
|
final Tags labradorTim = Tags.create("dog", "labrador", "name", "Tim");
|
|
|
|
|
final Tags eagleTim = Tags.createAndAddToDictionary("bird", "eagle", "name", "Tim");
|
|
|
|
|
final Tags pigeonJennifer = Tags.createAndAddToDictionary("bird", "pigeon", "name", "Jennifer");
|
|
|
|
|
final Tags flamingoJennifer = Tags.createAndAddToDictionary("bird", "flamingo", "name", "Jennifer");
|
|
|
|
|
final Tags labradorJenny = Tags.createAndAddToDictionary("dog", "labrador", "name", "Jenny");
|
|
|
|
|
final Tags labradorTim = Tags.createAndAddToDictionary("dog", "labrador", "name", "Tim");
|
|
|
|
|
|
|
|
|
|
tagsToBlockStorageRootBlockNumber = new HashMap<>();
|
|
|
|
|
tagsToBlockStorageRootBlockNumber.put(eagleTim, dataStore.createNewFile(eagleTim));
|
|
|
|
|
@@ -105,8 +105,8 @@ public class DataStoreTest {
|
|
|
|
|
|
|
|
|
|
dataStore = new DataStore(dataDirectory);
|
|
|
|
|
tagsToBlockStorageRootBlockNumber = new LinkedHashMap<>();
|
|
|
|
|
final Tags pigeonJennifer = Tags.create("bird", "pigeon", "name", "Jennifer");
|
|
|
|
|
final Tags flamingoJennifer = Tags.create("bird", "flamingo", "name", "Jennifer");
|
|
|
|
|
final Tags pigeonJennifer = Tags.createAndAddToDictionary("bird", "pigeon", "name", "Jennifer");
|
|
|
|
|
final Tags flamingoJennifer = Tags.createAndAddToDictionary("bird", "flamingo", "name", "Jennifer");
|
|
|
|
|
|
|
|
|
|
tagsToBlockStorageRootBlockNumber.put(pigeonJennifer, dataStore.createNewFile(pigeonJennifer));
|
|
|
|
|
tagsToBlockStorageRootBlockNumber.put(flamingoJennifer, dataStore.createNewFile(flamingoJennifer));
|
|
|
|
|
@@ -118,7 +118,7 @@ public class DataStoreTest {
|
|
|
|
|
public void testBlockAlignment() throws IOException {
|
|
|
|
|
|
|
|
|
|
dataStore = new DataStore(dataDirectory);
|
|
|
|
|
final Tags eagleTim = Tags.create("bird", "eagle", "name", "Tim");
|
|
|
|
|
final Tags eagleTim = Tags.createAndAddToDictionary("bird", "eagle", "name", "Tim");
|
|
|
|
|
final long eagleTimBlockOffset = dataStore.createNewFile(eagleTim);
|
|
|
|
|
Assert.assertEquals(eagleTimBlockOffset % BSFile.BLOCK_SIZE, 0);
|
|
|
|
|
}
|
|
|
|
|
@@ -166,18 +166,18 @@ public class DataStoreTest {
|
|
|
|
|
dataStore = new DataStore(dataDirectory);
|
|
|
|
|
|
|
|
|
|
final List<Tags> tags = Arrays.asList(
|
|
|
|
|
Tags.create("type", "bird", "subtype", "eagle", "age", "three", "name", "Tim"),
|
|
|
|
|
Tags.create("type", "bird", "subtype", "pigeon", "age", "two", "name", "Jennifer"),
|
|
|
|
|
Tags.create("type", "bird", "subtype", "flamingo", "age", "one", "name", "Jennifer"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "bird", "subtype", "eagle", "age", "three", "name", "Tim"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "bird", "subtype", "pigeon", "age", "two", "name", "Jennifer"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "bird", "subtype", "flamingo", "age", "one", "name", "Jennifer"),
|
|
|
|
|
|
|
|
|
|
Tags.create("type", "dog", "subtype", "labrador", "age", "three", "name", "Jenny"),
|
|
|
|
|
Tags.create("type", "dog", "subtype", "labrador", "age", "three", "name", "Tim"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "dog", "subtype", "labrador", "age", "three", "name", "Jenny"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "dog", "subtype", "labrador", "age", "three", "name", "Tim"),
|
|
|
|
|
|
|
|
|
|
Tags.create("type", "cat", "subtype", "tiger", "age", "one", "name", "Timothy"),
|
|
|
|
|
Tags.create("type", "cat", "subtype", "tiger", "age", "two", "name", "Paul"),
|
|
|
|
|
Tags.create("type", "cat", "subtype", "lion", "age", "three", "name", "Jane"),
|
|
|
|
|
Tags.create("type", "cat", "subtype", "lion", "age", "four", "name", "Sam"),
|
|
|
|
|
Tags.create("type", "cat", "subtype", "lion", "age", "four", "name", "John"));
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "tiger", "age", "one", "name", "Timothy"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "tiger", "age", "two", "name", "Paul"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "lion", "age", "three", "name", "Jane"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "lion", "age", "four", "name", "Sam"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "lion", "age", "four", "name", "John"));
|
|
|
|
|
|
|
|
|
|
tags.forEach(dataStore::createNewFile);
|
|
|
|
|
|
|
|
|
|
@@ -189,18 +189,21 @@ public class DataStoreTest {
|
|
|
|
|
try (DataStore dataStore = new DataStore(dir)) {
|
|
|
|
|
|
|
|
|
|
final List<Tags> tags = Arrays.asList(
|
|
|
|
|
Tags.create("type", "bird", "subtype", "eagle", "age", "three", "name", "Tim"),
|
|
|
|
|
Tags.create("type", "bird", "subtype", "pigeon", "age", "two", "name", "Jennifer"),
|
|
|
|
|
Tags.create("type", "bird", "subtype", "flamingo", "age", "one", "name", "Jennifer"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "bird", "subtype", "eagle", "age", "three", "name", "Tim"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "bird", "subtype", "pigeon", "age", "two", "name",
|
|
|
|
|
"Jennifer"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "bird", "subtype", "flamingo", "age", "one", "name",
|
|
|
|
|
"Jennifer"),
|
|
|
|
|
|
|
|
|
|
Tags.create("type", "dog", "subtype", "labrador", "age", "three", "name", "Jenny"),
|
|
|
|
|
Tags.create("type", "dog", "subtype", "labrador", "age", "three", "name", "Tim"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "dog", "subtype", "labrador", "age", "three", "name",
|
|
|
|
|
"Jenny"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "dog", "subtype", "labrador", "age", "three", "name", "Tim"),
|
|
|
|
|
|
|
|
|
|
Tags.create("type", "cat", "subtype", "tiger", "age", "one", "name", "Timothy"),
|
|
|
|
|
Tags.create("type", "cat", "subtype", "tiger", "age", "two", "name", "Paul"),
|
|
|
|
|
Tags.create("type", "cat", "subtype", "lion", "age", "three", "name", "Jane"),
|
|
|
|
|
Tags.create("type", "cat", "subtype", "lion", "age", "four", "name", "Sam"),
|
|
|
|
|
Tags.create("type", "cat", "subtype", "lion", "age", "four", "name", "John"));
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "tiger", "age", "one", "name", "Timothy"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "tiger", "age", "two", "name", "Paul"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "lion", "age", "three", "name", "Jane"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "lion", "age", "four", "name", "Sam"),
|
|
|
|
|
Tags.createAndAddToDictionary("type", "cat", "subtype", "lion", "age", "four", "name", "John"));
|
|
|
|
|
|
|
|
|
|
tags.forEach(dataStore::createNewFile);
|
|
|
|
|
|
|
|
|
|
|