use of com.navercorp.pinpoint.hbase.schema.core.HbaseSchemaStatus in project pinpoint by naver.
the class HbaseSchemaServiceImplTest method getSchemaStatus_noTables.
@Test
public void getSchemaStatus_noTables() {
final String namespace = "namespace";
final List<ChangeSet> changeSets = Arrays.asList(newChangeSet("id1", "value1"));
when(schemaChangeLogService.isAvailable(namespace)).thenReturn(false);
HbaseSchemaStatus schemaStatus = hbaseSchemaService.getSchemaStatus(namespace, changeSets);
MatcherAssert.assertThat(schemaStatus, is(HbaseSchemaStatus.NONE));
}
use of com.navercorp.pinpoint.hbase.schema.core.HbaseSchemaStatus in project pinpoint by naver.
the class HbaseSchemaServiceImplTest method getSchemaStatus_validButNeedUpdateSchemaChangeLogs.
@Test
public void getSchemaStatus_validButNeedUpdateSchemaChangeLogs() {
final String namespace = "namespace";
final List<ChangeSet> changeSets = Arrays.asList(newChangeSet("id1", "value1"), newChangeSet("id2", "value2"), newChangeSet("id3", "value3"));
final List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id1", "value1", 1), newSchemaChangeLog("id2", "value2", 2));
when(schemaChangeLogService.isAvailable(namespace)).thenReturn(true);
when(schemaChangeLogService.getSchemaChangeLogs(namespace)).thenReturn(schemaChangeLogs);
HbaseSchemaStatus schemaStatus = hbaseSchemaService.getSchemaStatus(namespace, changeSets);
MatcherAssert.assertThat(schemaStatus, is(HbaseSchemaStatus.VALID_OUT_OF_DATE));
}
use of com.navercorp.pinpoint.hbase.schema.core.HbaseSchemaStatus in project pinpoint by naver.
the class HbaseSchemaServiceImplTest method getSchemaStatus_validSchemaChangeLogs.
@Test
public void getSchemaStatus_validSchemaChangeLogs() {
final String namespace = "namespace";
final List<ChangeSet> changeSets = Arrays.asList(newChangeSet("id1", "value1"), newChangeSet("id2", "value2"), newChangeSet("id3", "value3"));
final List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id1", "value1", 1), newSchemaChangeLog("id2", "value2", 2), newSchemaChangeLog("id3", "value3", 3));
when(schemaChangeLogService.isAvailable(namespace)).thenReturn(true);
when(schemaChangeLogService.getSchemaChangeLogs(namespace)).thenReturn(schemaChangeLogs);
HbaseSchemaStatus schemaStatus = hbaseSchemaService.getSchemaStatus(namespace, changeSets);
MatcherAssert.assertThat(schemaStatus, is(HbaseSchemaStatus.VALID));
}
use of com.navercorp.pinpoint.hbase.schema.core.HbaseSchemaStatus in project pinpoint by naver.
the class HbaseSchemaServiceImplTest method getSchemaStatus_invalidSchemaChangeLogs.
@Test
public void getSchemaStatus_invalidSchemaChangeLogs() {
final String namespace = "namespace";
final List<ChangeSet> changeSets = Arrays.asList(newChangeSet("id1", "value1"), newChangeSet("id2", "value2"), newChangeSet("id3", "value3"));
final List<SchemaChangeLog> schemaChangeLogs = Arrays.asList(newSchemaChangeLog("id1", "value2", 2), newSchemaChangeLog("id2", "value1", 1), newSchemaChangeLog("someOtherId", "value3", 3));
when(schemaChangeLogService.isAvailable(namespace)).thenReturn(true);
when(schemaChangeLogService.getSchemaChangeLogs(namespace)).thenReturn(schemaChangeLogs);
HbaseSchemaStatus schemaStatus = hbaseSchemaService.getSchemaStatus(namespace, changeSets);
MatcherAssert.assertThat(schemaStatus, is(HbaseSchemaStatus.INVALID));
}
use of com.navercorp.pinpoint.hbase.schema.core.HbaseSchemaStatus in project pinpoint by naver.
the class HbaseSchemaServiceImplTest method getSchemaStatus_noSchemaChangeLogs.
@Test
public void getSchemaStatus_noSchemaChangeLogs() {
final String namespace = "namespace";
final List<ChangeSet> changeSets = Arrays.asList(newChangeSet("id1", "value1"));
when(schemaChangeLogService.isAvailable(namespace)).thenReturn(true);
when(schemaChangeLogService.getSchemaChangeLogs(namespace)).thenReturn(Collections.emptyList());
HbaseSchemaStatus schemaStatus = hbaseSchemaService.getSchemaStatus(namespace, changeSets);
MatcherAssert.assertThat(schemaStatus, is(HbaseSchemaStatus.NONE));
}
Aggregations