Skip to content

Commit

Permalink
Disable use of GcsIOChannelFactory on query10
Browse files Browse the repository at this point in the history
Make NexmarkOptions depend on GcpOptions instead of PubsubOptions

issue #21
  • Loading branch information
iemejia committed Aug 23, 2017
1 parent 1541fad commit 902050b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
5 changes: 0 additions & 5 deletions integration/java/nexmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,6 @@
<artifactId>google-api-services-bigquery</artifactId>
</dependency>

<dependency>
<groupId>com.google.cloud.bigdataoss</groupId>
<artifactId>gcsio</artifactId>
</dependency>

<!-- Extra libraries -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@
package org.apache.beam.integration.nexmark;

import javax.annotation.Nullable;
import org.apache.beam.sdk.extensions.gcp.options.GcpOptions;
import org.apache.beam.sdk.io.gcp.pubsub.PubsubOptions;
import org.apache.beam.sdk.options.ApplicationNameOptions;
import org.apache.beam.sdk.options.Default;
import org.apache.beam.sdk.options.Description;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.StreamingOptions;

/**
* Command line flags.
*/
public interface NexmarkOptions extends PubsubOptions {
public interface NexmarkOptions
extends ApplicationNameOptions, GcpOptions, PipelineOptions, StreamingOptions {
@Description("Which suite to run. Default is to use command line arguments for one job.")
@Default.Enum("DEFAULT")
NexmarkSuite getSuite();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.apache.beam.sdk.transforms.windowing.PaneInfo.Timing;
import org.apache.beam.sdk.transforms.windowing.Repeatedly;
import org.apache.beam.sdk.transforms.windowing.Window;
import org.apache.beam.sdk.util.GcsIOChannelFactory;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollection;
import org.joda.time.Duration;
Expand Down Expand Up @@ -133,11 +132,13 @@ public void setMaxNumWorkers(int maxNumWorkers) {
*/
private WritableByteChannel openWritableGcsFile(GcsOptions options, String filename)
throws IOException {
WritableByteChannel channel =
GcsIOChannelFactory.fromOptions(options).create(filename, "text/plain");
checkState(channel instanceof GoogleCloudStorageWriteChannel);
((GoogleCloudStorageWriteChannel) channel).setUploadBufferSize(CHANNEL_BUFFER);
return channel;
//TODO Decide what to do about this one
// WritableByteChannel channel =
// GcsIOChannelFactory.fromOptions(options).create(filename, "text/plain");
// checkState(channel instanceof GoogleCloudStorageWriteChannel);
// ((GoogleCloudStorageWriteChannel) channel).setUploadBufferSize(CHANNEL_BUFFER);
// return channel;
throw new UnsupportedOperationException("Disabled after removal of GcsIOChannelFactory");
}

/** Return a short string to describe {@code timing}. */
Expand Down

0 comments on commit 902050b

Please sign in to comment.