Skip to content
Permalink
Browse files
GIRAPH-1216
closes #99
  • Loading branch information
atanu1991 authored and dlogothetis committed Feb 22, 2019
1 parent 6d861f5 commit d3bf4a2cf5347f7cfd9d217b216c906cb7801217
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 44 deletions.
@@ -18,6 +18,9 @@
package org.apache.giraph.block_app.library.internal;

import java.util.Iterator;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.stream.StreamSupport;

import org.apache.giraph.block_app.framework.api.BlockWorkerReceiveApi;
import org.apache.giraph.block_app.framework.api.BlockWorkerSendApi;
@@ -39,7 +42,6 @@
import org.apache.hadoop.io.WritableComparable;

import com.google.common.base.Preconditions;
import com.google.common.collect.Iterators;

/**
* Piece that sends a message provided through messageProducer to given set of
@@ -103,14 +105,10 @@ public Boolean get(Vertex<I, V, E> vertex) {
new SupplierFromVertex<I, V, E, Iterator<I>>() {
@Override
public Iterator<I> get(Vertex<I, V, E> vertex) {
return Iterators.filter(
targetsSupplier.get(vertex),
new com.google.common.base.Predicate<I>() {
@Override
public boolean apply(I targetId) {
return stripePredicate.apply(targetId);
}
});
return StreamSupport.stream(
Spliterators.spliteratorUnknownSize(
targetsSupplier.get(vertex), Spliterator.ORDERED),
false).filter(stripePredicate::apply).iterator();
}
},
messagesConsumer));
@@ -18,7 +18,6 @@

package org.apache.giraph.edge;

import com.google.common.collect.Iterators;
import com.google.common.collect.UnmodifiableIterator;
import org.apache.giraph.utils.ExtendedDataInput;
import org.apache.giraph.utils.ExtendedDataOutput;
@@ -34,6 +33,7 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Collections;

/**
* {@link OutEdges} implementation backed by a byte array.
@@ -177,7 +177,7 @@ public Edge<I, E> next() {
@Override
public Iterator<Edge<I, E>> iterator() {
if (edgeCount == 0) {
return Iterators.emptyIterator();
return Collections.emptyListIterator();
} else {
return new ByteArrayEdgeIterator();
}
@@ -17,12 +17,11 @@
*/
package org.apache.giraph.factories;

import com.google.common.base.MoreObjects;
import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
import org.apache.giraph.utils.WritableUtils;
import org.apache.hadoop.io.Writable;

import com.google.common.base.Objects;

/**
* Factory class to create default message values.
*
@@ -51,7 +50,7 @@ public DefaultMessageValueFactory(Class<M> messageValueClass,
}

@Override public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("messageValueClass", messageValueClass)
.toString();
}
@@ -17,9 +17,9 @@
*/
package org.apache.giraph.jython;

import com.google.common.base.MoreObjects;
import org.apache.giraph.combiner.MessageCombiner;

import com.google.common.base.Objects;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

@@ -60,7 +60,7 @@ public void setTable(String table) {
}

@Override public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("table", table)
.add("partition_filter", partition_filter)
.toString();
@@ -93,7 +93,7 @@ public void setValue_column(String value_column) {
}

@Override public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("table", getTable())
.add("partition_filter", getPartition_filter())
.add("id_column", id_column)
@@ -138,7 +138,7 @@ public void setTarget_id_column(String target_id_column) {
}

@Override public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("table", getTable())
.add("partition_filter", getPartition_filter())
.add("source_id_column", source_id_column)
@@ -190,7 +190,7 @@ public void setValue_column(String value_column) {
}

@Override public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("table", table)
.add("partition", partition)
.add("id_column", id_column)
@@ -17,6 +17,7 @@
*/
package org.apache.giraph.scripting;

import com.google.common.base.MoreObjects;
import org.apache.giraph.graph.Language;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;
@@ -87,7 +88,7 @@ public boolean equals(Object obj) {

@Override
public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("path", path)
.add("deployType", deployType)
.add("language", language)
@@ -17,6 +17,7 @@
*/
package org.apache.giraph.types;

import com.google.common.base.MoreObjects;
import org.apache.hadoop.io.BooleanWritable;
import org.apache.hadoop.io.ByteWritable;
import org.apache.hadoop.io.DoubleWritable;
@@ -136,7 +137,7 @@ public int hashCode() {

@Override
public String toString() {
return Objects.toStringHelper(this)
return MoreObjects.toStringHelper(this)
.add("javaClass", javaClass.getSimpleName())
.add("writableClass", writableClass.getSimpleName())
.toString();
@@ -18,7 +18,7 @@

package org.apache.giraph.utils;

import com.google.common.collect.Iterators;
import java.util.Collections;

import java.util.Iterator;

@@ -43,7 +43,7 @@ public static <T> Iterable<T> get() {

@Override
public Iterator<T> iterator() {
return Iterators.emptyIterator();
return Collections.emptyIterator();
}
}

@@ -23,6 +23,7 @@
import java.util.List;
import java.util.Map.Entry;

import com.google.common.base.MoreObjects;
import org.apache.giraph.conf.GiraphConfiguration;
import org.apache.giraph.conf.GiraphConstants;
import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
@@ -36,7 +37,6 @@
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;

import com.google.common.base.Objects;
import com.google.common.collect.Lists;

/**
@@ -238,6 +238,7 @@ protected Vertex<I, V, E> makeVertex(I id, V value,

@Override
public String toString() {
return Objects.toStringHelper(this).add("vertices", vertices).toString();
return MoreObjects.toStringHelper(this).add(
"vertices", vertices).toString();
}
}
20 pom.xml
@@ -332,7 +332,7 @@ under the License.
<dep.fasterxml-jackson.version>2.1.2</dep.fasterxml-jackson.version>
<dep.fastutil.version>6.5.4</dep.fastutil.version>
<dep.google.findbugs.version>2.0.2</dep.google.findbugs.version>
<dep.guava.version>18.0</dep.guava.version>
<dep.guava.version>21.0</dep.guava.version>
<dep.hbase.version>0.94.16</dep.hbase.version>
<dep.hcatalog.version>0.5.0-incubating</dep.hcatalog.version>
<dep.hive.version>0.11.0</dep.hive.version>
@@ -632,16 +632,6 @@ under the License.
<exclude>commons-logging:commons-logging-api</exclude>
<!-- clashes with cglib:cglib-nodep -->
<exclude>cglib:cglib</exclude>
<!-- use guava -->
<exclude>com.google.collections:google-collections</exclude>
<!-- but not the badly numbered ones... -->
<exclude>com.google.guava:guava</exclude>
<!-- Clashes with com.google.code.findbugs:annotations and having both jars -->
<!-- as a dependency then clashes with the dependency checker (because it -->
<!-- is not very good at handling annotations). Use the annotations jar -->
<!-- instead which has all jsr305 annotations and the additional findbugs -->
<!-- stuff. -->
<exclude>com.google.code.findbugs:jsr305</exclude>
<!-- Use the official version at javax.servlet:javax.servlet-api -->
<exclude>org.eclipse.jetty.orbit:javax.servlet</exclude>
<!-- Renamed airlift modules -->
@@ -655,10 +645,6 @@ under the License.
<exclude>io.airlift:rack-packaging-experimental</exclude>
<exclude>io.airlift:rack-server-base-experimental</exclude>
</excludes>
<includes>
<!-- whitelist the well numbered guava releases -->
<include>com.google.guava:guava:[10.0.1,)</include>
</includes>
</bannedDependencies>
<requireMavenVersion>
<version>${project.maven.version}</version>
@@ -862,10 +848,6 @@ under the License.
<groupId>com.ning.maven.plugins</groupId>
<artifactId>maven-dependency-versions-check-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.ning.maven.plugins</groupId>
<artifactId>maven-duplicate-finder-plugin</artifactId>
</plugin>
</plugins>
</build>

0 comments on commit d3bf4a2

Please sign in to comment.