forked from apache/giraph
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07c746a
commit 6414512
Showing
8 changed files
with
139 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 9 additions & 4 deletions
13
goffish-giraph/src/main/java/in/dream_lab/goffish/giraph/RemoteVerticesFinder2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
goffish-giraph/src/main/java/in/dream_lab/goffish/giraph/SubgraphMasterCompute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package in.dream_lab.goffish.giraph; | ||
|
||
import org.apache.giraph.master.DefaultMasterCompute; | ||
|
||
/** | ||
* Created by anirudh on 17/03/17. | ||
*/ | ||
public class SubgraphMasterCompute extends DefaultMasterCompute { | ||
public static final String ID = "SubgraphPartitionMappingAggregator"; | ||
|
||
@Override | ||
public void compute() { | ||
long superstep = getSuperstep(); | ||
if (superstep == 0) { | ||
setComputation(RemoteVerticesFinder.class); | ||
} else if(superstep == 1) { | ||
setComputation(RemoteVerticesFinder2.class); | ||
} else if(superstep == 2) { | ||
setComputation(RemoteVerticesFinder3.class); | ||
} else { | ||
setComputation(GiraphSubgraphComputation.class); | ||
} | ||
} | ||
|
||
@Override | ||
public void initialize() throws InstantiationException, IllegalAccessException { | ||
registerAggregator(ID, SubgraphPartitionMappingAggregator.class); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...-giraph/src/main/java/in/dream_lab/goffish/giraph/SubgraphPartitionMappingAggregator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package in.dream_lab.goffish.giraph; | ||
|
||
import org.apache.giraph.aggregators.Aggregator; | ||
import org.apache.giraph.aggregators.BasicAggregator; | ||
import org.apache.giraph.utils.ExtendedByteArrayDataInput; | ||
import org.apache.giraph.utils.ExtendedByteArrayDataOutput; | ||
import org.apache.hadoop.io.*; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Created by anirudh on 17/03/17. | ||
*/ | ||
public class SubgraphPartitionMappingAggregator implements Aggregator<MapWritable> { | ||
MapWritable subgraphPartitionMap; | ||
|
||
public SubgraphPartitionMappingAggregator() { | ||
subgraphPartitionMap = (MapWritable) createInitialValue(); | ||
} | ||
|
||
@Override | ||
public void aggregate(MapWritable value) { | ||
subgraphPartitionMap.putAll(value); | ||
} | ||
|
||
@Override | ||
public MapWritable createInitialValue() { | ||
return new MapWritable(); | ||
} | ||
|
||
@Override | ||
public MapWritable getAggregatedValue() { | ||
return subgraphPartitionMap; | ||
} | ||
|
||
@Override | ||
public void setAggregatedValue(MapWritable value) { | ||
subgraphPartitionMap = value; | ||
} | ||
|
||
@Override | ||
public void reset() { | ||
subgraphPartitionMap = createInitialValue(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...sh-giraph/src/main/java/in/dream_lab/goffish/giraph/SubgraphPartitionMappingWritable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package in.dream_lab.goffish.giraph; | ||
|
||
import org.apache.hadoop.io.IntWritable; | ||
import org.apache.hadoop.io.LongWritable; | ||
import org.apache.hadoop.io.Writable; | ||
|
||
import java.io.DataInput; | ||
import java.io.DataOutput; | ||
import java.io.IOException; | ||
import java.util.HashMap; | ||
|
||
/** | ||
* Created by anirudh on 17/03/17. | ||
*/ | ||
public class SubgraphPartitionMappingWritable implements Writable { | ||
public HashMap<LongWritable, IntWritable> subgraphPartitionMap = new HashMap<>(); | ||
@Override | ||
public void write(DataOutput dataOutput) throws IOException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void readFields(DataInput dataInput) throws IOException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters