use of org.apache.beam.runners.core.metrics.MetricsContainerImpl in project beam by apache.
the class SpannerIOWriteTest method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
serviceFactory = new FakeServiceFactory();
ReadOnlyTransaction tx = mock(ReadOnlyTransaction.class);
when(serviceFactory.mockDatabaseClient().readOnlyTransaction()).thenReturn(tx);
// Capture batches sent to writeAtLeastOnceWithOptions.
when(serviceFactory.mockDatabaseClient().writeAtLeastOnceWithOptions(mutationBatchesCaptor.capture(), optionsCaptor.capture())).thenReturn(null);
// Simplest schema: a table with int64 key
preparePkMetadata(tx, Arrays.asList(pkMetadata("tEsT", "key", "ASC")));
prepareColumnMetadata(tx, Arrays.asList(columnMetadata("tEsT", "key", "INT64", CELLS_PER_KEY)));
// Setup the ProcessWideContainer for testing metrics are set.
MetricsContainerImpl container = new MetricsContainerImpl(null);
MetricsEnvironment.setProcessWideContainer(container);
}
Aggregations