use of org.bboxdb.storage.sstable.SSTableMetadataBuilder in project bboxdb by jnidzwetzki.
the class TestSSTableMetadataBuilder method testSSTableIndexBuilder1.
/**
* Build empty index
*/
@Test(timeout = 60000)
public void testSSTableIndexBuilder1() {
final SSTableMetadataBuilder ssTableIndexBuilder = new SSTableMetadataBuilder();
final TupleStoreMetaData metadata = ssTableIndexBuilder.getMetaData();
Assert.assertArrayEquals(new double[] {}, metadata.getBoundingBoxData(), 0.001d);
Assert.assertEquals(0, metadata.getTuples());
}
use of org.bboxdb.storage.sstable.SSTableMetadataBuilder in project bboxdb by jnidzwetzki.
the class TestSSTableMetadataBuilder method testSSTableIndexBuilder2.
/**
* Build index with one tuple
*/
@Test(timeout = 60000)
public void testSSTableIndexBuilder2() {
final SSTableMetadataBuilder ssTableIndexBuilder = new SSTableMetadataBuilder();
final BoundingBox boundingBox1 = new BoundingBox(1d, 2d);
final Tuple tuple1 = new Tuple("abc", boundingBox1, "".getBytes());
ssTableIndexBuilder.addTuple(tuple1);
final TupleStoreMetaData metadata = ssTableIndexBuilder.getMetaData();
Assert.assertArrayEquals(boundingBox1.toDoubleArray(), metadata.getBoundingBoxData(), 0.001d);
Assert.assertEquals(metadata.getOldestTupleVersionTimestamp(), metadata.getNewestTupleVersionTimestamp());
Assert.assertEquals(1, metadata.getTuples());
Assert.assertEquals(tuple1.getReceivedTimestamp(), metadata.getNewestTupleInsertedTimstamp());
}
use of org.bboxdb.storage.sstable.SSTableMetadataBuilder in project bboxdb by jnidzwetzki.
the class TestSSTableMetadataBuilder method testSSTableIndexBuilder3.
/**
* Build index with two tuples
*/
@Test(timeout = 60000)
public void testSSTableIndexBuilder3() {
final SSTableMetadataBuilder ssTableIndexBuilder = new SSTableMetadataBuilder();
final BoundingBox boundingBox1 = new BoundingBox(1d, 2d);
final Tuple tuple1 = new Tuple("abc", boundingBox1, "".getBytes());
final Tuple tuple2 = new Tuple("def", boundingBox1, "".getBytes());
ssTableIndexBuilder.addTuple(tuple1);
ssTableIndexBuilder.addTuple(tuple2);
final TupleStoreMetaData metadata = ssTableIndexBuilder.getMetaData();
Assert.assertArrayEquals(boundingBox1.toDoubleArray(), metadata.getBoundingBoxData(), 0.001d);
Assert.assertEquals(2, metadata.getTuples());
}
use of org.bboxdb.storage.sstable.SSTableMetadataBuilder in project bboxdb by jnidzwetzki.
the class TestSSTableMetadataBuilder method testSSTableIndexBuilder7.
/**
* Build index with two tuples - bounding boxes are differ in the dimension
*/
@Test(timeout = 60000)
public void testSSTableIndexBuilder7() {
final SSTableMetadataBuilder ssTableIndexBuilder = new SSTableMetadataBuilder();
addTwoTuples(ssTableIndexBuilder);
final TupleStoreMetaData metadata = ssTableIndexBuilder.getMetaData();
Assert.assertArrayEquals(new double[] { 1d, 2d, 1d, 5f }, metadata.getBoundingBoxData(), 0.001d);
Assert.assertEquals(2, metadata.getTuples());
}
use of org.bboxdb.storage.sstable.SSTableMetadataBuilder in project bboxdb by jnidzwetzki.
the class TestSSTableMetadataBuilder method testDumpAndReadFromYamlStrig2.
/**
* Dump the index to yaml and reread the data
*/
@Test(timeout = 60000)
public void testDumpAndReadFromYamlStrig2() {
final SSTableMetadataBuilder ssTableIndexBuilder = new SSTableMetadataBuilder();
addTwoTuples(ssTableIndexBuilder);
final TupleStoreMetaData metaData = ssTableIndexBuilder.getMetaData();
final String yamlData = metaData.exportToYaml();
final TupleStoreMetaData metaDataRead = TupleStoreMetaData.importFromYaml(yamlData);
Assert.assertEquals(metaData, metaDataRead);
}
Aggregations