Search in sources :

Example 11 with TupleStoreMetaData

use of org.bboxdb.storage.entity.TupleStoreMetaData in project bboxdb by jnidzwetzki.

the class TestSSTableMetadataBuilder method readFromNonEstingFile.

/**
 * Read from non existing file
 */
@Test()
public void readFromNonEstingFile() {
    final File tmpFile = new File("/tmp/medatadafile");
    final TupleStoreMetaData metaDataRead = TupleStoreMetaData.importFromYamlFile(tmpFile);
    Assert.assertTrue(metaDataRead == null);
}
Also used : TupleStoreMetaData(org.bboxdb.storage.entity.TupleStoreMetaData) File(java.io.File) Test(org.junit.Test)

Example 12 with TupleStoreMetaData

use of org.bboxdb.storage.entity.TupleStoreMetaData in project bboxdb by jnidzwetzki.

the class TestSSTableMetadataBuilder method testDumpAndReadFromYamlFile1.

/**
 * Dump the index to yaml file and reread the data - zero tuples
 * @throws IOException
 */
@Test(timeout = 60000)
public void testDumpAndReadFromYamlFile1() throws IOException {
    final SSTableMetadataBuilder ssTableIndexBuilder = new SSTableMetadataBuilder();
    final File tmpFile = File.createTempFile("test", ".tmp");
    final TupleStoreMetaData metaData = ssTableIndexBuilder.getMetaData();
    metaData.exportToYamlFile(tmpFile);
    final TupleStoreMetaData metaDataRead = TupleStoreMetaData.importFromYamlFile(tmpFile);
    Assert.assertEquals(metaData, metaDataRead);
    tmpFile.delete();
}
Also used : TupleStoreMetaData(org.bboxdb.storage.entity.TupleStoreMetaData) SSTableMetadataBuilder(org.bboxdb.storage.sstable.SSTableMetadataBuilder) File(java.io.File) Test(org.junit.Test)

Example 13 with TupleStoreMetaData

use of org.bboxdb.storage.entity.TupleStoreMetaData in project bboxdb by jnidzwetzki.

the class SSTableWriter method writeMetadata.

/**
 * Write the meta data to yaml info file
 * @throws IOException
 */
private void writeMetadata() throws IOException {
    final TupleStoreMetaData metadata = metadataBuilder.getMetaData();
    metadata.exportToYamlFile(metadatafile);
}
Also used : TupleStoreMetaData(org.bboxdb.storage.entity.TupleStoreMetaData)

Aggregations

TupleStoreMetaData (org.bboxdb.storage.entity.TupleStoreMetaData)13 Test (org.junit.Test)12 SSTableMetadataBuilder (org.bboxdb.storage.sstable.SSTableMetadataBuilder)11 BoundingBox (org.bboxdb.commons.math.BoundingBox)6 DeletedTuple (org.bboxdb.storage.entity.DeletedTuple)6 Tuple (org.bboxdb.storage.entity.Tuple)6 File (java.io.File)3