Skip to content

Commit 137d435

Browse files
author
Sahil Takiar
committed
Fixing new FindBugs warnings, and setting Travis build to fail if new FindBugs warnings are added
1 parent 5cd9d96 commit 137d435

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

gobblin-data-management/src/main/java/gobblin/data/management/convertion/hive/LongWatermark.java

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
package gobblin.data.management.convertion.hive;
1313

1414
import lombok.AllArgsConstructor;
15+
import lombok.EqualsAndHashCode;
1516
import lombok.Getter;
1617

1718
import com.google.gson.Gson;
@@ -24,11 +25,13 @@
2425
*/
2526
@Getter
2627
@AllArgsConstructor
28+
@EqualsAndHashCode
2729
public class LongWatermark implements Watermark, Comparable<LongWatermark> {
2830

2931
private static final Gson GSON = new Gson();
3032

3133
private long value;
34+
3235
@Override
3336
public JsonElement toJson() {
3437
return GSON.toJsonTree(this);

gobblin-data-management/src/main/java/gobblin/data/management/copy/hive/HiveDatasetFinder.java

+3
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ public Iterator<HiveDataset> getDatasetsIterator()
136136
@Nullable
137137
@Override
138138
public HiveDataset apply(@Nullable DbAndTable dbAndTable) {
139+
if (dbAndTable == null) {
140+
return null;
141+
}
139142
try (AutoReturnableObject<IMetaStoreClient> client = clientPool.getClient()) {
140143
Table table = client.get().getTable(dbAndTable.getDb(), dbAndTable.getTable());
141144
return createHiveDataset(table);

gobblin-data-management/src/main/java/gobblin/data/management/copy/hive/HiveUtils.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
import java.util.Map;
1818
import java.util.Set;
1919

20+
import javax.annotation.Nullable;
21+
2022
import org.apache.commons.lang3.reflect.ConstructorUtils;
23+
2124
import org.apache.hadoop.conf.Configuration;
2225
import org.apache.hadoop.fs.Path;
2326
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
@@ -31,6 +34,7 @@
3134
import org.apache.hadoop.mapred.InputSplit;
3235
import org.apache.hadoop.mapred.JobConf;
3336
import org.apache.hadoop.mapred.JobConfigurable;
37+
3438
import org.apache.thrift.TException;
3539

3640
import com.google.common.base.Function;
@@ -56,7 +60,10 @@ public static Map<List<String>, Partition> getPartitionsMap(IMetaStoreClient cli
5660
Optional<String> filter) throws IOException {
5761
return Maps.uniqueIndex(getPartitions(client, table, filter), new Function<Partition, List<String>>() {
5862
@Override
59-
public List<String> apply(Partition partition) {
63+
public List<String> apply(@Nullable Partition partition) {
64+
if (partition == null) {
65+
return null;
66+
}
6067
return partition.getValues();
6168
}
6269
});

gobblin-data-management/src/main/java/gobblin/data/management/copy/hive/WhitelistBlacklist.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public boolean acceptDb(String db) {
7777
* @return Whether the input table is accepted by this {@link WhitelistBlacklist}.
7878
*/
7979
public boolean acceptTable(String db, String table) {
80-
return accept(db, Optional.of(table));
80+
return accept(db, Optional.fromNullable(table));
8181
}
8282

8383
private boolean accept(String db, Optional<String> table) {

ligradle/findbugs/findbugsExclude.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</Match>
2525
<!-- Ignored until https://github.com/linkedin/gobblin/issues/969 has been resolved -->
2626
<Match>
27-
<Class name="gobblin.metastore.DatabaseJobHistoryStore" />
27+
<Class name="~gobblin\.metastore\.database\.DatabaseJobHistoryStoreV.*" />
2828
<Bug pattern="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING" />
2929
</Match>
3030
<!-- Ignored until https://github.com/linkedin/gobblin/issues/976 has been resolved -->

travis/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
#!/bin/bash
1919
set -e
2020

21-
./gradlew clean assemble -Dorg.gradle.parallel=false
21+
./gradlew clean build -x test -Dorg.gradle.parallel=false

0 commit comments

Comments
 (0)