Search in sources :

Example 1 with Table

use of com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table in project esop by instaclustr.

the class ManifestComponentsTest method testTableEquality.

@Test
public void testTableEquality() throws Exception {
    Manifest manifest = parseManifest();
    Snapshot snapshot = manifest.getSnapshot();
    Keyspace keyspace = snapshot.getKeyspace("ks1").orElseThrow(IllegalStateException::new);
    Table table = keyspace.getTable("ks1t1").orElseThrow(IllegalStateException::new);
    Table cloned = table.clone();
    assertNotSame(table, cloned);
    assertEquals(table, cloned);
    cloned.add("me-1-big-Data.db", new ManifestEntry(Paths.get("abc/def"), null, Type.FILE, 50, null, null));
    assertNotEquals(table, cloned);
}
Also used : Snapshot(com.instaclustr.esop.impl.Snapshots.Snapshot) Table(com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table) KeyspaceTable(com.instaclustr.esop.impl.KeyspaceTable) ManifestEntry(com.instaclustr.esop.impl.ManifestEntry) Keyspace(com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace) Manifest(com.instaclustr.esop.impl.Manifest) Test(org.testng.annotations.Test)

Example 2 with Table

use of com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table in project esop by instaclustr.

the class ManifestComponentsTest method testSnapshotEquality.

@Test
public void testSnapshotEquality() throws Exception {
    Manifest manifest = parseManifest();
    Snapshot snapshot = manifest.getSnapshot();
    Snapshot cloned = snapshot.clone();
    assertNotSame(cloned, snapshot);
    assertEquals(cloned, snapshot);
    Keyspace ks = new Keyspace(new HashMap<>());
    Table tb = snapshot.getTable("ks1", "ks1t2").orElseThrow(IllegalStateException::new);
    ks.add("t100", tb);
    cloned.add("k100", ks);
    assertNotEquals(snapshot, cloned);
}
Also used : Snapshot(com.instaclustr.esop.impl.Snapshots.Snapshot) Table(com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table) KeyspaceTable(com.instaclustr.esop.impl.KeyspaceTable) Keyspace(com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace) Manifest(com.instaclustr.esop.impl.Manifest) Test(org.testng.annotations.Test)

Example 3 with Table

use of com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table in project esop by instaclustr.

the class ManifestComponentsTest method testSchemaParsing.

@Test
public void testSchemaParsing() throws Exception {
    Manifest manifest = parseManifest();
    Table t1 = manifest.getSnapshot().getKeyspace("ks1").get().getTable("ks1t1").get();
    Table t2 = manifest.getSnapshot().getKeyspace("ks1").get().getTable("ks1t1").get();
    assertTrue(t1.schemaEqualsTo(t2.getSchemaContent()));
    assertTrue(t1.schemaEqualsTo(t2));
}
Also used : Table(com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table) KeyspaceTable(com.instaclustr.esop.impl.KeyspaceTable) Manifest(com.instaclustr.esop.impl.Manifest) Test(org.testng.annotations.Test)

Aggregations

KeyspaceTable (com.instaclustr.esop.impl.KeyspaceTable)3 Manifest (com.instaclustr.esop.impl.Manifest)3 Table (com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table)3 Test (org.testng.annotations.Test)3 Snapshot (com.instaclustr.esop.impl.Snapshots.Snapshot)2 Keyspace (com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace)2 ManifestEntry (com.instaclustr.esop.impl.ManifestEntry)1