[
https://issues.apache.org/jira/browse/BEAM-9822?focusedWorklogId=435171&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-435171
]
ASF GitHub Bot logged work on BEAM-9822:
----------------------------------------
Author: ASF GitHub Bot
Created on: 19/May/20 20:24
Start Date: 19/May/20 20:24
Worklog Time Spent: 10m
Work Description: TheNeuralBit commented on a change in pull request
#11529:
URL: https://github.com/apache/beam/pull/11529#discussion_r427576985
##########
File path:
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIOWriteTest.java
##########
@@ -263,6 +263,17 @@ private void verifyBatches(Iterable<Mutation>... batches) {
@Test
public void noBatching() throws Exception {
+
+ // This test uses a different mock/fake because it explicitly does not
want to populate the
+ // Spanner schema.
+ FakeServiceFactory fakeServiceFactory = new FakeServiceFactory();
+ ReadOnlyTransaction tx = mock(ReadOnlyTransaction.class);
+
when(fakeServiceFactory.mockDatabaseClient().readOnlyTransaction()).thenReturn(tx);
+
+ // Capture batches sent to writeAtLeastOnce.
+
when(fakeServiceFactory.mockDatabaseClient().writeAtLeastOnce(mutationBatchesCaptor.capture()))
+ .thenReturn(null);
+
Review comment:
This doesn't seem to be used. It seems we should either:
- Pass `fakeServiceFactory` to `withServiceFactory` and the verify calls
below, or
- Just remove `fakeServiceFactory` and use `serviceFactory` here instead. It
seems to be capable of verifying that the schema isn't read, so I'm not sure
there's value in building another fake that doesn't have a schema.
I'd prefer the latter, but I'd be fine with the former if you think that's
better.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 435171)
Time Spent: 6h 50m (was: 6h 40m)
> SpannerIO: Reduce memory usage - especially when streaming
> ----------------------------------------------------------
>
> Key: BEAM-9822
> URL: https://issues.apache.org/jira/browse/BEAM-9822
> Project: Beam
> Issue Type: Bug
> Components: io-java-gcp
> Affects Versions: 2.20.0, 2.21.0
> Reporter: Niel Markwick
> Assignee: Niel Markwick
> Priority: P2
> Labels: google-cloud-spanner
> Fix For: 2.22.0
>
> Time Spent: 6h 50m
> Remaining Estimate: 0h
>
> SpannerIO uses a lot of memory.
> In Streaming Dataflow, it uses many times as much (because dataflow creates
> many worker threads)
> Lower the memory use, and change default parameters during streaming to use
> smaller batches and disable grouping.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)