Skip to content

Commit

Permalink
Incorporate reviews and rebase on latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp authored and lukecwik committed Jan 29, 2018
1 parent 2970b53 commit ce740eb
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 53 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ sdks/python/apache_beam/portability/api/*pb2*.*
**/.fbExcludeFilterFile
**/.apt_generated/**/*
**/.settings/**/*
**/.gitignore

# Ignore Visual Studio Code files.
**/.vscode/**/*
Expand Down
12 changes: 7 additions & 5 deletions build_rules.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ ext.applyJavaNature = {
testApt auto_service
}


// Add the optional and provided configurations for dependencies
// TODO: Either remove these plugins and find another way to generate the Maven poms
// with the correct dependency scopes configured.
Expand All @@ -239,6 +238,13 @@ ext.applyJavaNature = {
maxErrors = 0
}

// Apply the eclipse and apt-eclipse plugins. This adds the "eclipse" task and
// connects the apt-eclipse plugin to update the eclipse project files
// with the instructions needed to run apt within eclipse to handle the AutoValue
// and additional annotations
apply plugin: 'eclipse'
apply plugin: "net.ltgt.apt-eclipse"

// Enables a plugin which can apply code formatting to source.
// TODO: Should this plugin be enabled for all projects?
apply plugin: "com.diffplug.gradle.spotless"
Expand Down Expand Up @@ -435,8 +441,4 @@ ext.applyAvroNature = {
apply plugin: "com.commercehub.gradle.plugin.avro"
}

// Apply the apt-eclipse plugin so the eclipse import can work
apply plugin: 'eclipse'
apply plugin: "net.ltgt.apt-eclipse"


23 changes: 11 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@

<!-- Default skipping -->
<rat.skip>true</rat.skip>

</properties>

<packaging>pom</packaging>
Expand Down Expand Up @@ -1772,17 +1771,17 @@
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<versionRange>[2.0.0,)</versionRange>
<goals>
<goal>format</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
<pluginExecutionFilter>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<versionRange>[2.0.0,)</versionRange>
<goals>
<goal>format</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import scala.Option;
import scala.Tuple2;
import scala.Tuple3;
import scala.collection.GenTraversable;
import scala.collection.Iterator;
import scala.collection.Seq;
import scala.runtime.AbstractFunction1;
Expand Down Expand Up @@ -272,12 +273,12 @@ private Collection<TimerInternals.TimerData> filterTimersEligibleForProcessing(
if (!encodedKeyedElements.isEmpty()) {
// new input for key.
try {
//cast to GenTraversable to avoid a ambiguous call to head() which can come from
//mulitple super interfacesof Seq<byte[]>
byte[] b = ((scala.collection.GenTraversable<byte[]>) encodedKeyedElements).head();
// cast to GenTraversable to avoid a ambiguous call to head() which can come from
// multiple super interfacesof Seq<byte[]>
byte[] headBytes = ((GenTraversable<byte[]>) encodedKeyedElements).head();
final KV<Long, Iterable<WindowedValue<InputT>>> keyedElements =
CoderHelpers.fromByteArray(
b, KvCoder.of(VarLongCoder.of(), itrWvCoder));
headBytes, KvCoder.of(VarLongCoder.of(), itrWvCoder));

final Long rddTimestamp = keyedElements.getKey();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,9 @@ void verifyCompatible(CoderT coder, Type candidateType) throws IncompatibleCoder
}
for (int i = 0; i < typeArgumentCoders.size(); i++) {
try {
Coder<?> c2 = typeArgumentCoders.get(i);
Coder<?> typeArgumentCoder = typeArgumentCoders.get(i);
verifyCompatible(
c2,
typeArgumentCoder,
candidateDescriptor.resolveType(typeArguments[i]).getType());
} catch (IncompatibleCoderException exn) {
throw new IncompatibleCoderException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public static <T, W extends BoundedWindow> Map<W, Set<String>> runWindowFnWithVa
for (W window : assignedWindowsWithValue(windowFn, element)) {
windowSet.put(window, timestampValue(element.getTimestamp().getMillis()));
}
TestMergeContext<T, W> tmc = new TestMergeContext<>(windowSet, windowFn);
windowFn.mergeWindows(tmc);
TestMergeContext<T, W> mergeContext = new TestMergeContext<>(windowSet, windowFn);
windowFn.mergeWindows(mergeContext);
}
Map<W, Set<String>> actual = new HashMap<>();
for (W window : windowSet.windows()) {
Expand All @@ -113,8 +113,8 @@ public static <T, W extends BoundedWindow> Collection<W> assignedWindows(
*/
public static <T, W extends BoundedWindow> Collection<W> assignedWindowsWithValue(
WindowFn<T, W> windowFn, TimestampedValue<T> timestampedValue) throws Exception {
TestAssignContext<T, W> tac = new TestAssignContext<>(timestampedValue, windowFn);
return windowFn.assignWindows(tac);
TestAssignContext<T, W> assignContext = new TestAssignContext<>(timestampedValue, windowFn);
return windowFn.assignWindows(assignContext);
}

private static String timestampValue(long timestamp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public BeamSqlCaseExpression(List<BeamSqlExpression> operands) {

@Override public BeamSqlPrimitive evaluate(BeamRecord inputRow, BoundedWindow window) {
for (int i = 0; i < operands.size() - 1; i += 2) {
Boolean b = opValueEvaluated(i, inputRow, window);
if (b != null && b) {
Boolean wasOpEvaluated = opValueEvaluated(i, inputRow, window);
if (wasOpEvaluated != null && wasOpEvaluated) {
return BeamSqlPrimitive.of(
outputType,
opValueEvaluated(i + 1, inputRow, window)
Expand Down
48 changes: 24 additions & 24 deletions sdks/java/maven-archetypes/examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,30 @@
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<versionRange>[1.5.0,)</versionRange>
<goals>
<goal>exec</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<versionRange>[1.5.0,)</versionRange>
<goals>
<goal>exec</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Expand Down

0 comments on commit ce740eb

Please sign in to comment.