Author: edwardyoon
Date: Thu Nov 10 14:20:33 2011
New Revision: 1200338
URL: http://svn.apache.org/viewvc?rev=1200338&view=rev
Log:
float casting.
Modified:
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
Modified:
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
URL:
http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java?rev=1200338&r1=1200337&r2=1200338&view=diff
==============================================================================
---
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
(original)
+++
incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJobClient.java
Thu Nov 10 14:20:33 2011
@@ -216,8 +216,8 @@ public class BSPJobClient extends Config
if (masterAdress != null && !masterAdress.equals("local")) {
this.jobSubmitClient = (JobSubmissionProtocol) RPC.getProxy(
JobSubmissionProtocol.class, JobSubmissionProtocol.versionID,
- BSPMaster.getAddress(conf), conf,
- NetUtils.getSocketFactory(conf, JobSubmissionProtocol.class));
+ BSPMaster.getAddress(conf), conf, NetUtils.getSocketFactory(conf,
+ JobSubmissionProtocol.class));
} else {
LOG.debug("Using local BSP runner.");
this.jobSubmitClient = new LocalBSPRunner(conf);
@@ -296,7 +296,7 @@ public class BSPJobClient extends Config
public RunningJob submitJobInternal(BSPJob job) throws IOException {
BSPJobID jobId = jobSubmitClient.getNewJobId();
-
+
job.setJobID(jobId);
Path submitJobDir = new Path(getSystemDir(), "submit_"
@@ -388,7 +388,7 @@ public class BSPJobClient extends Config
}
}
- @SuppressWarnings({ "rawtypes", "unchecked" })
+ @SuppressWarnings( { "rawtypes", "unchecked" })
private BSPJob partition(BSPJob job) throws IOException {
if (job.getConf().get("bsp.input.partitioner.class") != null) {
InputSplit[] splits = job.getInputFormat().getSplits(job,
@@ -426,8 +426,8 @@ public class BSPJobClient extends Config
job, null);
CompressionCodec codec = null;
if (outputCompressorClass != null) {
- codec = ReflectionUtils.newInstance(outputCompressorClass,
- job.getConf());
+ codec = ReflectionUtils.newInstance(outputCompressorClass, job
+ .getConf());
}
try {
@@ -451,7 +451,8 @@ public class BSPJobClient extends Config
Object key = recordReader.createKey();
Object value = recordReader.createValue();
while (recordReader.next(key, value)) {
- int index = Math.abs(partitioner.getPartition(key, value,
numOfTasks));
+ int index = Math.abs(partitioner.getPartition(key, value,
+ numOfTasks));
writers.get(index).append(key, value);
}
LOG.debug("Done with split " + i);
@@ -599,8 +600,8 @@ public class BSPJobClient extends Config
if (step == 0) {
report = "Wait for tasks that have not yet been activated: "
- + ((getClusterStatus(false).getTasks() / job.getNumBspTask()) *
100)
- + "%";
+ + ((float) getClusterStatus(false).getTasks()
+ / (float) job.getNumBspTask() * 100) + "%";
} else {
report = "Current supersteps number: " + step;
}
@@ -804,9 +805,8 @@ public class BSPJobClient extends Config
System.out.println("Job name: " + job.getJobName());
System.out.printf("States are:\n\tRunning : 1\tSucceded : 2"
+ "\tFailed : 3\tPrep : 4\n");
- System.out.printf("%s\t%d\t%d\t%s\n", jobStatus.getJobID(),
- jobStatus.getRunState(), jobStatus.getStartTime(),
- jobStatus.getUsername());
+ System.out.printf("%s\t%d\t%d\t%s\n", jobStatus.getJobID(), jobStatus
+ .getRunState(), jobStatus.getStartTime(), jobStatus.getUsername());
exitCode = 0;
}