public class BspCase extends Object implements org.apache.zookeeper.Watcher
Modifier and Type | Field and Description |
---|---|
static String |
READER_VERTICES_OPT |
Constructor and Description |
---|
BspCase(String testName)
Create the test case
|
Modifier and Type | Method and Description |
---|---|
static String |
getCallingMethodName() |
int |
getNumResults(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path outputPath)
Read all parts- files in the output and count their lines.
|
int |
getNumWorkers()
Get the number of workers used in the BSP application
|
static org.apache.hadoop.fs.FileStatus |
getSinglePartFileStatus(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path partDirPath)
Get the single part file status and make sure there is only one part
|
protected org.apache.hadoop.fs.Path |
getTempPath(String name)
Create a temporary path
|
String |
getZooKeeperList()
Get the ZooKeeper list
|
protected GiraphJob |
prepareJob(String name,
GiraphConfiguration conf)
Prepare a GiraphJob for test purposes
|
protected GiraphJob |
prepareJob(String name,
GiraphConfiguration conf,
org.apache.hadoop.fs.Path outputPath)
Prepare a GiraphJob for test purposes
|
void |
process(org.apache.zookeeper.WatchedEvent event) |
static void |
removeAndSetOutput(GiraphJob job,
org.apache.hadoop.fs.Path outputPath)
Helper method to remove an old output directory if it exists,
and set the output path for any VertexOutputFormat that uses
FileOutputFormat.
|
boolean |
runningInDistributedMode()
Are the tests executed on a real hadoop instance?
|
void |
setUp() |
org.apache.hadoop.conf.Configuration |
setupConfiguration(GiraphJob job)
Adjust the configuration to the basic test case
|
void |
tearDown() |
public static final String READER_VERTICES_OPT
public BspCase(String testName)
testName
- name of the test casepublic final org.apache.hadoop.conf.Configuration setupConfiguration(GiraphJob job) throws IOException
IOException
protected org.apache.hadoop.fs.Path getTempPath(String name)
name
- name of the file to create in the temporary folderprotected GiraphJob prepareJob(String name, GiraphConfiguration conf) throws IOException
name
- identifying name for jobconf
- GiraphConfiguration describing which classes to useIOException
- if anything goes wrongprotected GiraphJob prepareJob(String name, GiraphConfiguration conf, org.apache.hadoop.fs.Path outputPath) throws IOException
name
- identifying name for jobconf
- GiraphConfiguration describing which classes to useoutputPath
- Where to right output toIOException
- if anything goes wrongpublic int getNumWorkers()
public String getZooKeeperList()
public boolean runningInDistributedMode()
public static org.apache.hadoop.fs.FileStatus getSinglePartFileStatus(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path partDirPath) throws IOException
conf
- Configuration to get the file system frompartDirPath
- Directory where the single part file should existIOException
public int getNumResults(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path outputPath) throws IOException
conf
- ConfigurationoutputPath
- Output pathIOException
public void setUp()
public void tearDown() throws IOException
IOException
public void process(org.apache.zookeeper.WatchedEvent event)
process
in interface org.apache.zookeeper.Watcher
public static void removeAndSetOutput(GiraphJob job, org.apache.hadoop.fs.Path outputPath) throws IOException
job
- Job to set the output path foroutputPath
- Path to outputIOException
public static String getCallingMethodName()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.