use of com.torodb.core.transaction.metainf.ImmutableMetaSnapshot in project torodb by torodb.
the class SqlTorodServer method disableDataImportMode.
@Override
public void disableDataImportMode() {
ImmutableMetaSnapshot snapshot = internalTransactionManager.takeMetaSnapshot();
backend.disableDataImportMode(snapshot);
}
use of com.torodb.core.transaction.metainf.ImmutableMetaSnapshot in project torodb by torodb.
the class IdentifierFactoryImplTest method longForCounterWithCollisionCharacterDatabaseToIdentifierTest.
@Test
public void longForCounterWithCollisionCharacterDatabaseToIdentifierTest() {
ImmutableMetaSnapshot metaSnapshot = new ImmutableMetaSnapshot.Builder().put(new ImmutableMetaDatabase.Builder("database_collider", "database_long_long_long_long_long_long_long_long_long_long_longong_long_long_long_long_long_long_long_long_long_long_long_long_1")).build();
String identifier = identifierFactory.toDatabaseIdentifier(metaSnapshot, "database_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long");
Assert.assertEquals("database_long_long_long_long_long_long_long_long_long_long_longong_long_long_long_long_long_long_long_long_long_long_long_long_2", identifier);
}
use of com.torodb.core.transaction.metainf.ImmutableMetaSnapshot in project torodb by torodb.
the class IdentifierFactoryImplTest method emptyDatabaseToIdentifierTest.
@Test
public void emptyDatabaseToIdentifierTest() {
ImmutableMetaSnapshot metaSnapshot = new ImmutableMetaSnapshot.Builder().build();
String identifier = identifierFactory.toDatabaseIdentifier(metaSnapshot, "");
Assert.assertEquals("", identifier);
}
use of com.torodb.core.transaction.metainf.ImmutableMetaSnapshot in project torodb by torodb.
the class IdentifierFactoryImplTest method long128DatabaseToIdentifierTest.
@Test
public void long128DatabaseToIdentifierTest() {
ImmutableMetaSnapshot metaSnapshot = new ImmutableMetaSnapshot.Builder().build();
String identifier = identifierFactory.toDatabaseIdentifier(metaSnapshot, "database_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long");
Assert.assertEquals("database_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long", identifier);
}
use of com.torodb.core.transaction.metainf.ImmutableMetaSnapshot in project torodb by torodb.
the class SnapshotMergerForIndexTest method testNewIndexMultiField.
/**
* Test a new index with multiple fields Case [1&1.OK1|1&2.OK1].2
*
* @throws Exception
*/
@Test
public void testNewIndexMultiField() throws Exception {
MutableMetaSnapshot currentModifiedSnapshot = new WrapperMutableMetaSnapshot(currentSnapshot);
ImmutableMetaSnapshot currentSnapshot = currentModifiedSnapshot.immutableCopy();
MutableMetaSnapshot changedSnapshot = new WrapperMutableMetaSnapshot(currentSnapshot);
changedSnapshot.getMetaDatabaseByName("dbName1").getMetaCollectionByName("colName1").addMetaIndex("idxName2", false).addMetaIndexField(tableRefFactory.createRoot(), "fieldName2", FieldIndexOrdering.ASC);
changedSnapshot.getMetaDatabaseByName("dbName1").getMetaCollectionByName("colName1").getMetaIndexByName("idxName2").addMetaIndexField(tableRefFactory.createRoot(), "fieldName3", FieldIndexOrdering.ASC);
changedSnapshot.getMetaDatabaseByName("dbName1").getMetaCollectionByName("colName1").getMetaIndexByName("idxName2").addMetaIndexField(tableRefFactory.createRoot(), "fieldName4", FieldIndexOrdering.ASC);
changedSnapshot.getMetaDatabaseByName("dbName1").getMetaCollectionByName("colName1").getMetaIndexByName("idxName2").addMetaIndexField(tableRefFactory.createRoot(), "fieldName5", FieldIndexOrdering.ASC);
new SnapshotMerger(currentSnapshot, changedSnapshot).merge();
}
Aggregations