Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0FED4200C6C for ; Fri, 21 Apr 2017 00:10:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0EA3D160BB0; Thu, 20 Apr 2017 22:10:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B3E24160B9F for ; Fri, 21 Apr 2017 00:10:24 +0200 (CEST) Received: (qmail 67163 invoked by uid 500); 20 Apr 2017 22:10:23 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 67153 invoked by uid 99); 20 Apr 2017 22:10:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Apr 2017 22:10:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CB737F4A1F; Thu, 20 Apr 2017 22:10:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dhalperi@apache.org To: commits@beam.apache.org Date: Thu, 20 Apr 2017 22:10:23 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] beam git commit: [BEAM-59] FileBasedSource: convert to FileSystem archived-at: Thu, 20 Apr 2017 22:10:26 -0000 Repository: beam Updated Branches: refs/heads/master 4f8b1cc22 -> e44918881 http://git-wip-us.apache.org/repos/asf/beam/blob/49b8b230/sdks/java/core/src/test/java/org/apache/beam/sdk/io/FileBasedSourceTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/io/FileBasedSourceTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/io/FileBasedSourceTest.java index 94a29da..c15e667 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/io/FileBasedSourceTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/io/FileBasedSourceTest.java @@ -26,11 +26,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.mockito.Mockito.when; -import com.google.common.collect.ImmutableList; import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; @@ -39,21 +38,23 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.NoSuchElementException; import java.util.Random; +import javax.annotation.Nullable; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.io.FileBasedSource.FileBasedReader; import org.apache.beam.sdk.io.Source.Reader; +import org.apache.beam.sdk.io.fs.MatchResult.Metadata; import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.options.PipelineOptionsFactory; +import org.apache.beam.sdk.options.ValueProvider.StaticValueProvider; import org.apache.beam.sdk.testing.NeedsRunner; import org.apache.beam.sdk.testing.PAssert; import org.apache.beam.sdk.testing.TestPipeline; import org.apache.beam.sdk.util.CoderUtils; -import org.apache.beam.sdk.util.IOChannelFactory; -import org.apache.beam.sdk.util.IOChannelUtils; import org.apache.beam.sdk.values.PCollection; import org.junit.Rule; import org.junit.Test; @@ -62,7 +63,6 @@ import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.mockito.Mockito; /** * Tests code common to all file-based sources. @@ -70,7 +70,7 @@ import org.mockito.Mockito; @RunWith(JUnit4.class) public class FileBasedSourceTest { - Random random = new Random(0L); + private Random random = new Random(0L); @Rule public final TestPipeline p = TestPipeline.create(); @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @@ -89,16 +89,16 @@ public class FileBasedSourceTest { final String splitHeader; public TestFileBasedSource(String fileOrPattern, long minBundleSize, String splitHeader) { - super(fileOrPattern, minBundleSize); + super(StaticValueProvider.of(fileOrPattern), minBundleSize); this.splitHeader = splitHeader; } public TestFileBasedSource( - String fileOrPattern, + Metadata fileOrPattern, long minBundleSize, long startOffset, long endOffset, - String splitHeader) { + @Nullable String splitHeader) { super(fileOrPattern, minBundleSize, startOffset, endOffset); this.splitHeader = splitHeader; } @@ -113,7 +113,7 @@ public class FileBasedSourceTest { @Override protected FileBasedSource createForSubrangeOfFile( - String fileName, long start, long end) { + Metadata fileName, long start, long end) { return new TestFileBasedSource(fileName, getMinBundleSize(), start, end, splitHeader); } @@ -397,30 +397,12 @@ public class FileBasedSourceTest { } @Test - public void testSplittingUsingFullThreadPool() throws Exception { - int numFiles = FileBasedSource.THREAD_POOL_SIZE * 5; - File file0 = null; - for (int i = 0; i < numFiles; i++) { - List data = createStringDataset(3, 1000); - File file = createFileWithData("file" + i, data); - if (i == 0) { - file0 = file; - } - } - - TestFileBasedSource source = - new TestFileBasedSource(file0.getParent() + "/" + "file*", Long.MAX_VALUE, null); - List> splits = source.split(Long.MAX_VALUE, null); - assertEquals(numFiles, splits.size()); - } - - @Test public void testSplittingFailsOnEmptyFileExpansion() throws Exception { PipelineOptions options = PipelineOptionsFactory.create(); String missingFilePath = tempFolder.newFolder().getAbsolutePath() + "/missing.txt"; TestFileBasedSource source = new TestFileBasedSource(missingFilePath, Long.MAX_VALUE, null); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage(String.format("Unable to find any files matching %s", missingFilePath)); + thrown.expect(FileNotFoundException.class); + thrown.expectMessage(String.format("No files found for spec: %s", missingFilePath)); source.split(1234, options); } @@ -460,16 +442,7 @@ public class FileBasedSourceTest { PipelineOptions options = PipelineOptionsFactory.create(); File file1 = createFileWithData("file1", new ArrayList()); - IOChannelFactory mockIOFactory = Mockito.mock(IOChannelFactory.class); - String parent = file1.getParent(); - String pattern = "mocked://test"; - when(mockIOFactory.match(pattern)) - .thenReturn( - ImmutableList.of( - new File(parent, "file1").getPath(), - new File(parent, "file2").getPath(), - new File(parent, "file3").getPath())); - IOChannelUtils.setIOFactoryInternal("mocked", mockIOFactory, true /* override */); + String pattern = file1.getParent() + "/file*"; List data2 = createStringDataset(3, 50); createFileWithData("file2", data2); @@ -496,9 +469,10 @@ public class FileBasedSourceTest { String fileName = "file"; File file = createFileWithData(fileName, data); - TestFileBasedSource source1 = new TestFileBasedSource(file.getPath(), 64, 0, 25, null); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); + TestFileBasedSource source1 = new TestFileBasedSource(metadata, 64, 0, 25, null); TestFileBasedSource source2 = - new TestFileBasedSource(file.getPath(), 64, 25, Long.MAX_VALUE, null); + new TestFileBasedSource(metadata, 64, 25, Long.MAX_VALUE, null); List results = new ArrayList(); results.addAll(readFromSource(source1, options)); @@ -523,7 +497,7 @@ public class FileBasedSourceTest { List expectedResults = new ArrayList(); expectedResults.addAll(data); // Remove all occurrences of header from expected results. - expectedResults.removeAll(Arrays.asList(header)); + expectedResults.removeAll(Collections.singletonList(header)); assertEquals(expectedResults, readFromSource(source, options)); } @@ -540,9 +514,10 @@ public class FileBasedSourceTest { String fileName = "file"; File file = createFileWithData(fileName, data); - TestFileBasedSource source1 = new TestFileBasedSource(file.getPath(), 64, 0, 60, header); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); + TestFileBasedSource source1 = new TestFileBasedSource(metadata, 64, 0, 60, header); TestFileBasedSource source2 = - new TestFileBasedSource(file.getPath(), 64, 60, Long.MAX_VALUE, header); + new TestFileBasedSource(metadata, 64, 60, Long.MAX_VALUE, header); List expectedResults = new ArrayList(); expectedResults.addAll(data); @@ -568,16 +543,17 @@ public class FileBasedSourceTest { String fileName = "file"; File file = createFileWithData(fileName, data); - TestFileBasedSource source1 = new TestFileBasedSource(file.getPath(), 64, 0, 42, header); - TestFileBasedSource source2 = new TestFileBasedSource(file.getPath(), 64, 42, 112, header); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); + TestFileBasedSource source1 = new TestFileBasedSource(metadata, 64, 0, 42, header); + TestFileBasedSource source2 = new TestFileBasedSource(metadata, 64, 42, 112, header); TestFileBasedSource source3 = - new TestFileBasedSource(file.getPath(), 64, 112, Long.MAX_VALUE, header); + new TestFileBasedSource(metadata, 64, 112, Long.MAX_VALUE, header); List expectedResults = new ArrayList(); expectedResults.addAll(data); // Remove all occurrences of header from expected results. - expectedResults.removeAll(Arrays.asList(header)); + expectedResults.removeAll(Collections.singletonList(header)); List results = new ArrayList<>(); results.addAll(readFromSource(source1, options)); @@ -599,16 +575,17 @@ public class FileBasedSourceTest { String fileName = "file"; File file = createFileWithData(fileName, data); - TestFileBasedSource source1 = new TestFileBasedSource(file.getPath(), 64, 0, 42, header); - TestFileBasedSource source2 = new TestFileBasedSource(file.getPath(), 64, 42, 62, header); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); + TestFileBasedSource source1 = new TestFileBasedSource(metadata, 64, 0, 42, header); + TestFileBasedSource source2 = new TestFileBasedSource(metadata, 64, 42, 62, header); TestFileBasedSource source3 = - new TestFileBasedSource(file.getPath(), 64, 62, Long.MAX_VALUE, header); + new TestFileBasedSource(metadata, 64, 62, Long.MAX_VALUE, header); List expectedResults = new ArrayList(); expectedResults.addAll(data); // Remove all occurrences of header from expected results. - expectedResults.removeAll(Arrays.asList(header)); + expectedResults.removeAll(Collections.singletonList(header)); List results = new ArrayList<>(); results.addAll(readFromSource(source1, options)); @@ -633,19 +610,20 @@ public class FileBasedSourceTest { List expectedResults = new ArrayList(); expectedResults.addAll(data.subList(10, data.size())); // Remove all occurrences of header from expected results. - expectedResults.removeAll(Arrays.asList(header)); + expectedResults.removeAll(Collections.singletonList(header)); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); // Split starts after "<" of the header TestFileBasedSource source = - new TestFileBasedSource(file.getPath(), 64, 1, Long.MAX_VALUE, header); + new TestFileBasedSource(metadata, 64, 1, Long.MAX_VALUE, header); assertThat(expectedResults, containsInAnyOrder(readFromSource(source, options).toArray())); // Split starts after "" of the header - source = new TestFileBasedSource(file.getPath(), 64, 3, Long.MAX_VALUE, header); + source = new TestFileBasedSource(metadata, 64, 3, Long.MAX_VALUE, header); assertThat(expectedResults, containsInAnyOrder(readFromSource(source, options).toArray())); } @@ -656,10 +634,11 @@ public class FileBasedSourceTest { String fileName = "file"; File file = createFileWithData(fileName, data); - TestFileBasedSource source1 = new TestFileBasedSource(file.getPath(), 64, 0, 52, null); - TestFileBasedSource source2 = new TestFileBasedSource(file.getPath(), 64, 52, 72, null); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); + TestFileBasedSource source1 = new TestFileBasedSource(metadata, 64, 0, 52, null); + TestFileBasedSource source2 = new TestFileBasedSource(metadata, 64, 52, 72, null); TestFileBasedSource source3 = - new TestFileBasedSource(file.getPath(), 64, 72, Long.MAX_VALUE, null); + new TestFileBasedSource(metadata, 64, 72, Long.MAX_VALUE, null); List results = new ArrayList<>(); results.addAll(readFromSource(source1, options)); @@ -677,9 +656,10 @@ public class FileBasedSourceTest { String fileName = "file"; File file = createFileWithData(fileName, data); - TestFileBasedSource source1 = new TestFileBasedSource(file.getPath(), 64, 0, 162, null); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); + TestFileBasedSource source1 = new TestFileBasedSource(metadata, 64, 0, 162, null); TestFileBasedSource source2 = - new TestFileBasedSource(file.getPath(), 1024, 162, Long.MAX_VALUE, null); + new TestFileBasedSource(metadata, 1024, 162, Long.MAX_VALUE, null); List results = new ArrayList<>(); results.addAll(readFromSource(source1, options)); @@ -793,74 +773,6 @@ public class FileBasedSourceTest { } @Test - public void testEstimatedSizeOfFilePatternAllThreads() throws Exception { - File file0 = null; - int numFiles = FileBasedSource.THREAD_POOL_SIZE * 5; - long totalSize = 0; - for (int i = 0; i < numFiles; i++) { - List data = createStringDataset(3, 20); - File file = createFileWithData("file" + i, data); - if (i == 0) { - file0 = file; - } - totalSize += file.length(); - } - - TestFileBasedSource source = - new TestFileBasedSource(new File(file0.getParent(), "file*").getPath(), 64, null); - - // Since all files are of equal size, sampling should produce the exact result. - assertEquals(totalSize, source.getEstimatedSizeBytes(null)); - } - - @Test - public void testEstimatedSizeOfFilePatternThroughSamplingEqualSize() throws Exception { - // When all files are of equal size, we should get the exact size. - int numFilesToTest = FileBasedSource.MAX_NUMBER_OF_FILES_FOR_AN_EXACT_STAT * 2; - File file0 = null; - for (int i = 0; i < numFilesToTest; i++) { - List data = createStringDataset(3, 20); - File file = createFileWithData("file" + i, data); - if (i == 0) { - file0 = file; - } - } - - long actualTotalSize = file0.length() * numFilesToTest; - TestFileBasedSource source = - new TestFileBasedSource(new File(file0.getParent(), "file*").getPath(), 64, null); - assertEquals(actualTotalSize, source.getEstimatedSizeBytes(null)); - } - - @Test - public void testEstimatedSizeOfFilePatternThroughSamplingDifferentSizes() throws Exception { - float tolerableError = 0.2f; - int numFilesToTest = FileBasedSource.MAX_NUMBER_OF_FILES_FOR_AN_EXACT_STAT * 2; - File file0 = null; - - // Keeping sizes of files close to each other to make sure that the test passes reliably. - Random rand = new Random(System.currentTimeMillis()); - int dataSizeBase = 100; - int dataSizeDelta = 10; - - long actualTotalSize = 0; - for (int i = 0; i < numFilesToTest; i++) { - List data = createStringDataset( - 3, (int) (dataSizeBase + rand.nextFloat() * dataSizeDelta * 2 - dataSizeDelta)); - File file = createFileWithData("file" + i, data); - if (i == 0) { - file0 = file; - } - actualTotalSize += file.length(); - } - - TestFileBasedSource source = - new TestFileBasedSource(new File(file0.getParent(), "file*").getPath(), 64, null); - assertEquals((double) actualTotalSize, (double) source.getEstimatedSizeBytes(null), - actualTotalSize * tolerableError); - } - - @Test public void testReadAllSplitsOfFilePattern() throws Exception { PipelineOptions options = PipelineOptionsFactory.create(); List data1 = createStringDataset(3, 50); @@ -900,7 +812,8 @@ public class FileBasedSourceTest { PipelineOptions options = PipelineOptionsFactory.create(); File file = createFileWithData("file", createStringDataset(3, 100)); - TestFileBasedSource source = new TestFileBasedSource(file.getPath(), 1, 0, file.length(), null); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); + TestFileBasedSource source = new TestFileBasedSource(metadata, 1, 0, file.length(), null); // Shouldn't be able to split while unstarted. assertSplitAtFractionFails(source, 0, 0.7, options); assertSplitAtFractionSucceedsAndConsistent(source, 1, 0.7, options); @@ -918,21 +831,16 @@ public class FileBasedSourceTest { // Smaller file for exhaustive testing. File file = createFileWithData("file", createStringDataset(3, 20)); - TestFileBasedSource source = new TestFileBasedSource(file.getPath(), 1, 0, file.length(), null); + Metadata metadata = FileSystems.matchSingleFileSpec(file.getPath()); + TestFileBasedSource source = new TestFileBasedSource(metadata, 1, 0, file.length(), null); assertSplitAtFractionExhaustive(source, options); } @Test public void testToStringFile() throws Exception { - String path = "/tmp/foo"; - TestFileBasedSource source = new TestFileBasedSource(path, 1, 0, 10, null); - assertEquals(String.format("%s range [0, 10)", path), source.toString()); - } - - @Test - public void testToStringPattern() throws Exception { - String path = "/tmp/foo/*"; - TestFileBasedSource source = new TestFileBasedSource(path, 1, 0, 10, null); - assertEquals(String.format("%s range [0, 10)", path), source.toString()); + File f = createFileWithData("foo", Collections.emptyList()); + Metadata metadata = FileSystems.matchSingleFileSpec(f.getPath()); + TestFileBasedSource source = new TestFileBasedSource(metadata, 1, 0, 10, null); + assertEquals(String.format("%s range [0, 10)", f.getAbsolutePath()), source.toString()); } } http://git-wip-us.apache.org/repos/asf/beam/blob/49b8b230/sdks/java/core/src/test/java/org/apache/beam/sdk/util/AvroUtilsTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/AvroUtilsTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/AvroUtilsTest.java index d8c345c..d42f8ed 100644 --- a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/AvroUtilsTest.java +++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/AvroUtilsTest.java @@ -33,6 +33,8 @@ import org.apache.avro.io.DatumWriter; import org.apache.avro.reflect.Nullable; import org.apache.beam.sdk.coders.AvroCoder; import org.apache.beam.sdk.coders.DefaultCoder; +import org.apache.beam.sdk.io.FileSystems; +import org.apache.beam.sdk.io.fs.MatchResult.Metadata; import org.apache.beam.sdk.util.AvroUtils.AvroMetadata; import org.junit.Rule; import org.junit.Test; @@ -83,7 +85,9 @@ public class AvroUtilsTest { for (String codec : codecs) { String filename = generateTestFile( codec, expected, AvroCoder.of(Bird.class), codec); - AvroMetadata metadata = AvroUtils.readMetadataFromFile(filename); + + Metadata fileMeta = FileSystems.matchSingleFileSpec(filename); + AvroMetadata metadata = AvroUtils.readMetadataFromFile(fileMeta.resourceId()); assertEquals(codec, metadata.getCodec()); } } @@ -94,7 +98,8 @@ public class AvroUtilsTest { String codec = DataFileConstants.NULL_CODEC; String filename = generateTestFile( codec, expected, AvroCoder.of(Bird.class), codec); - AvroMetadata metadata = AvroUtils.readMetadataFromFile(filename); + Metadata fileMeta = FileSystems.matchSingleFileSpec(filename); + AvroMetadata metadata = AvroUtils.readMetadataFromFile(fileMeta.resourceId()); // By default, parse validates the schema, which is what we want. Schema schema = new Schema.Parser().parse(metadata.getSchemaString()); assertEquals(8, schema.getFields().size()); http://git-wip-us.apache.org/repos/asf/beam/blob/49b8b230/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/GcsUtil.java ---------------------------------------------------------------------- diff --git a/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/GcsUtil.java b/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/GcsUtil.java index 1c853bb..d0dfd3e 100644 --- a/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/GcsUtil.java +++ b/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/GcsUtil.java @@ -636,9 +636,8 @@ public class GcsUtil { return batches; } - public void copy(Iterable srcFilenames, - Iterable destFilenames) throws - IOException { + public void copy(Iterable srcFilenames, Iterable destFilenames) + throws IOException { executeBatches(makeCopyBatches(srcFilenames, destFilenames)); } http://git-wip-us.apache.org/repos/asf/beam/blob/49b8b230/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/gcsfs/GcsPath.java ---------------------------------------------------------------------- diff --git a/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/gcsfs/GcsPath.java b/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/gcsfs/GcsPath.java index 863b01b..6a71bdc 100644 --- a/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/gcsfs/GcsPath.java +++ b/sdks/java/extensions/gcp-core/src/main/java/org/apache/beam/sdk/util/gcsfs/GcsPath.java @@ -23,6 +23,7 @@ import static com.google.common.base.Strings.isNullOrEmpty; import com.google.api.services.storage.model.StorageObject; import java.io.File; import java.io.IOException; +import java.io.Serializable; import java.net.URI; import java.net.URISyntaxException; import java.nio.file.FileSystem; @@ -68,7 +69,7 @@ import javax.annotation.Nullable; * "http://docs.oracle.com/javase/tutorial/essential/io/pathOps.html" * >Java Tutorials: Path Operations */ -public class GcsPath implements Path { +public class GcsPath implements Path, Serializable { public static final String SCHEME = "gs"; @@ -176,7 +177,7 @@ public class GcsPath implements Path { } @Nullable - private FileSystem fs; + private transient FileSystem fs; @Nonnull private final String bucket; @Nonnull http://git-wip-us.apache.org/repos/asf/beam/blob/49b8b230/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIOTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIOTest.java b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIOTest.java index 3653753..713a9a9 100644 --- a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIOTest.java +++ b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIOTest.java @@ -503,8 +503,7 @@ public class BigtableIOTest { null /*filter*/, ByteKeyRange.ALL_KEYS, null /*size*/); - List splits = - source.split(numRows * bytesPerRow / numSplits, null); + List splits = source.split(numRows * bytesPerRow / numSplits, null); // Test num splits and split equality. assertThat(splits, hasSize(numSplits)); @@ -529,8 +528,7 @@ public class BigtableIOTest { RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*17.*")).build(); BigtableSource source = new BigtableSource(serviceFactory, table, filter, ByteKeyRange.ALL_KEYS, null /*size*/); - List splits = - source.split(numRows * bytesPerRow / numSplits, null); + List splits = source.split(numRows * bytesPerRow / numSplits, null); // Test num splits and split equality. assertThat(splits, hasSize(numSplits)); http://git-wip-us.apache.org/repos/asf/beam/blob/49b8b230/sdks/java/io/hadoop/input-format/src/test/java/org/apache/beam/sdk/io/hadoop/inputformat/HadoopInputFormatIOTest.java ---------------------------------------------------------------------- diff --git a/sdks/java/io/hadoop/input-format/src/test/java/org/apache/beam/sdk/io/hadoop/inputformat/HadoopInputFormatIOTest.java b/sdks/java/io/hadoop/input-format/src/test/java/org/apache/beam/sdk/io/hadoop/inputformat/HadoopInputFormatIOTest.java index da70632..ccde03f 100644 --- a/sdks/java/io/hadoop/input-format/src/test/java/org/apache/beam/sdk/io/hadoop/inputformat/HadoopInputFormatIOTest.java +++ b/sdks/java/io/hadoop/input-format/src/test/java/org/apache/beam/sdk/io/hadoop/inputformat/HadoopInputFormatIOTest.java @@ -643,7 +643,7 @@ public class HadoopInputFormatIOTest { * {@link HadoopInputFormatBoundedSource#createReader(PipelineOptions)} * createReader()} method when * {@link HadoopInputFormatBoundedSource#split(long, PipelineOptions)} - * split()} is not called. + * is not called. */ @Test public void testCreateReaderIfSplitNotCalled() throws Exception {