You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hcatalog-commits@incubator.apache.org by tr...@apache.org on 2012/09/10 23:29:03 UTC
svn commit: r1383152 [27/27] - in /incubator/hcatalog/trunk: ./
hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/
hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/drivers/
hcatalog-pig-adapter/src/test/java/org/apache/hcatalog/pig/ ...
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/TableDesc.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/TableDesc.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/TableDesc.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/TableDesc.java Mon Sep 10 23:28:55 2012
@@ -40,7 +40,8 @@ public class TableDesc extends GroupPerm
/**
* Create a new TableDesc
*/
- public TableDesc() {}
+ public TableDesc() {
+ }
public String toString() {
return String.format("TableDesc(table=%s, columns=%s)", table, columns);
@@ -49,18 +50,18 @@ public class TableDesc extends GroupPerm
public boolean equals(Object o) {
if (this == o)
return true;
- if (! (o instanceof TableDesc))
+ if (!(o instanceof TableDesc))
return false;
TableDesc that = (TableDesc) o;
- return xequals(this.external, that.external)
- && xequals(this.ifNotExists, that.ifNotExists)
- && xequals(this.table, that.table)
- && xequals(this.comment, that.comment)
- && xequals(this.columns, that.columns)
- && xequals(this.partitionedBy, that.partitionedBy)
- && xequals(this.clusteredBy, that.clusteredBy)
- && xequals(this.format, that.format)
- && xequals(this.location, that.location)
+ return xequals(this.external, that.external)
+ && xequals(this.ifNotExists, that.ifNotExists)
+ && xequals(this.table, that.table)
+ && xequals(this.comment, that.comment)
+ && xequals(this.columns, that.columns)
+ && xequals(this.partitionedBy, that.partitionedBy)
+ && xequals(this.clusteredBy, that.clusteredBy)
+ && xequals(this.format, that.format)
+ && xequals(this.location, that.location)
&& xequals(this.tableProperties, that.tableProperties)
&& super.equals(that)
;
@@ -75,7 +76,8 @@ public class TableDesc extends GroupPerm
public List<ClusterSortOrderDesc> sortedBy;
public int numberOfBuckets;
- public ClusteredByDesc() {}
+ public ClusteredByDesc() {
+ }
public String toString() {
String fmt
@@ -86,11 +88,11 @@ public class TableDesc extends GroupPerm
public boolean equals(Object o) {
if (this == o)
return true;
- if (! (o instanceof ClusteredByDesc))
+ if (!(o instanceof ClusteredByDesc))
return false;
ClusteredByDesc that = (ClusteredByDesc) o;
- return xequals(this.columnNames, that.columnNames)
- && xequals(this.sortedBy, that.sortedBy)
+ return xequals(this.columnNames, that.columnNames)
+ && xequals(this.sortedBy, that.sortedBy)
&& xequals(this.numberOfBuckets, that.numberOfBuckets)
;
}
@@ -104,7 +106,8 @@ public class TableDesc extends GroupPerm
public String columnName;
public SortDirectionDesc order;
- public ClusterSortOrderDesc() {}
+ public ClusterSortOrderDesc() {
+ }
public ClusterSortOrderDesc(String columnName, SortDirectionDesc order) {
this.columnName = columnName;
@@ -114,17 +117,17 @@ public class TableDesc extends GroupPerm
public String toString() {
return String
.format("ClusterSortOrderDesc(columnName=%s, order=%s)",
- columnName, order);
+ columnName, order);
}
public boolean equals(Object o) {
if (this == o)
return true;
- if (! (o instanceof ClusterSortOrderDesc))
+ if (!(o instanceof ClusterSortOrderDesc))
return false;
ClusterSortOrderDesc that = (ClusterSortOrderDesc) o;
- return xequals(this.columnName, that.columnName)
- && xequals(this.order, that.order)
+ return xequals(this.columnName, that.columnName)
+ && xequals(this.order, that.order)
;
}
}
@@ -146,17 +149,18 @@ public class TableDesc extends GroupPerm
public String storedAs;
public StoredByDesc storedBy;
- public StorageFormatDesc() {}
+ public StorageFormatDesc() {
+ }
public boolean equals(Object o) {
if (this == o)
return true;
- if (! (o instanceof StorageFormatDesc))
+ if (!(o instanceof StorageFormatDesc))
return false;
StorageFormatDesc that = (StorageFormatDesc) o;
- return xequals(this.rowFormat, that.rowFormat)
- && xequals(this.storedAs, that.storedAs)
- && xequals(this.storedBy, that.storedBy)
+ return xequals(this.rowFormat, that.rowFormat)
+ && xequals(this.storedAs, that.storedAs)
+ && xequals(this.storedBy, that.storedBy)
;
}
}
@@ -172,20 +176,21 @@ public class TableDesc extends GroupPerm
public String linesTerminatedBy;
public SerdeDesc serde;
- public RowFormatDesc() {}
+ public RowFormatDesc() {
+ }
public boolean equals(Object o) {
if (this == o)
return true;
- if (! (o instanceof RowFormatDesc))
+ if (!(o instanceof RowFormatDesc))
return false;
RowFormatDesc that = (RowFormatDesc) o;
- return xequals(this.fieldsTerminatedBy, that.fieldsTerminatedBy)
+ return xequals(this.fieldsTerminatedBy, that.fieldsTerminatedBy)
&& xequals(this.collectionItemsTerminatedBy,
- that.collectionItemsTerminatedBy)
- && xequals(this.mapKeysTerminatedBy, that.mapKeysTerminatedBy)
- && xequals(this.linesTerminatedBy, that.linesTerminatedBy)
- && xequals(this.serde, that.serde)
+ that.collectionItemsTerminatedBy)
+ && xequals(this.mapKeysTerminatedBy, that.mapKeysTerminatedBy)
+ && xequals(this.linesTerminatedBy, that.linesTerminatedBy)
+ && xequals(this.serde, that.serde)
;
}
}
@@ -198,16 +203,17 @@ public class TableDesc extends GroupPerm
public String name;
public Map<String, String> properties;
- public SerdeDesc() {}
+ public SerdeDesc() {
+ }
public boolean equals(Object o) {
if (this == o)
return true;
- if (! (o instanceof SerdeDesc))
+ if (!(o instanceof SerdeDesc))
return false;
SerdeDesc that = (SerdeDesc) o;
- return xequals(this.name, that.name)
- && xequals(this.properties, that.properties)
+ return xequals(this.name, that.name)
+ && xequals(this.properties, that.properties)
;
}
}
@@ -220,16 +226,17 @@ public class TableDesc extends GroupPerm
public String className;
public Map<String, String> properties;
- public StoredByDesc() {}
+ public StoredByDesc() {
+ }
public boolean equals(Object o) {
if (this == o)
return true;
- if (! (o instanceof StoredByDesc))
+ if (!(o instanceof StoredByDesc))
return false;
StoredByDesc that = (StoredByDesc) o;
- return xequals(this.className, that.className)
- && xequals(this.properties, that.properties)
+ return xequals(this.className, that.className)
+ && xequals(this.properties, that.properties)
;
}
}
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/TableLikeDesc.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/TableLikeDesc.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/TableLikeDesc.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/TableLikeDesc.java Mon Sep 10 23:28:55 2012
@@ -30,10 +30,11 @@ public class TableLikeDesc extends Group
public String existingTable;
public String newTable;
- public TableLikeDesc() {}
+ public TableLikeDesc() {
+ }
public String toString() {
return String.format("TableLikeDesc(existingTable=%s, newTable=%s, location=%s",
- existingTable, newTable, location);
+ existingTable, newTable, location);
}
}
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/UgiFactory.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/UgiFactory.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/UgiFactory.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/UgiFactory.java Mon Sep 10 23:28:55 2012
@@ -24,15 +24,15 @@ import org.apache.hadoop.security.UserGr
public class UgiFactory {
private static ConcurrentHashMap<String, UserGroupInformation> userUgiMap =
- new ConcurrentHashMap<String, UserGroupInformation>();
-
- static UserGroupInformation getUgi(String user) throws IOException{
+ new ConcurrentHashMap<String, UserGroupInformation>();
+
+ static UserGroupInformation getUgi(String user) throws IOException {
UserGroupInformation ugi = userUgiMap.get(user);
- if(ugi == null){
+ if (ugi == null) {
//create new ugi and add to map
- final UserGroupInformation newUgi =
- UserGroupInformation.createProxyUser(user,
- UserGroupInformation.getLoginUser());
+ final UserGroupInformation newUgi =
+ UserGroupInformation.createProxyUser(user,
+ UserGroupInformation.getLoginUser());
//if another thread adds an entry before the check in this one
// the one created here will not be added.
@@ -40,10 +40,10 @@ public class UgiFactory {
//use the UGI object that got added
return userUgiMap.get(user);
-
+
}
return ugi;
}
-
-
+
+
}
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/WadlConfig.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/WadlConfig.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/WadlConfig.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/WadlConfig.java Mon Sep 10 23:28:55 2012
@@ -26,15 +26,15 @@ import com.sun.jersey.server.wadl.genera
/**
* Simple class that incorporates javadoc information into the
* wadl produced by jersey.
- *
+ *
*/
public class WadlConfig extends WadlGeneratorConfig {
-
+
@Override
public List<WadlGeneratorDescription> configure() {
- return generator( WadlGeneratorResourceDocSupport.class )
- .prop( "resourceDocStream", "resourcedoc.xml" )
- .descriptions();
+ return generator(WadlGeneratorResourceDocSupport.class)
+ .prop("resourceDocStream", "resourcedoc.xml")
+ .descriptions();
}
-
+
}
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/HDFSStorage.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/HDFSStorage.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/HDFSStorage.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/HDFSStorage.java Mon Sep 10 23:28:55 2012
@@ -75,7 +75,7 @@ public class HDFSStorage implements Temp
out.write(val);
} catch (IOException e) {
LOG.info("Couldn't write to " + getPath(type) + "/" + id + ": "
- + e.getMessage());
+ + e.getMessage());
} finally {
try {
out.flush();
@@ -90,13 +90,12 @@ public class HDFSStorage implements Temp
public String getField(Type type, String id, String key) {
BufferedReader in = null;
try {
- in = new BufferedReader(new InputStreamReader
- (fs.open(new Path(getPath(type) + "/" +
- id + "/" + key))));
+ in = new BufferedReader(new InputStreamReader(fs.open(new Path(getPath(type) + "/" +
+ id + "/" + key))));
String line = null;
String val = "";
while ((line = in.readLine()) != null) {
- if (! val.equals("")) {
+ if (!val.equals("")) {
val += "\n";
}
val += line;
@@ -104,7 +103,7 @@ public class HDFSStorage implements Temp
return val;
} catch (IOException e) {
LOG.trace("Couldn't find " + getPath(type) + "/" + id + "/" + key
- + ": " + e.getMessage());
+ + ": " + e.getMessage());
} finally {
try {
in.close();
@@ -120,10 +119,8 @@ public class HDFSStorage implements Temp
HashMap<String, String> map = new HashMap<String, String>();
BufferedReader in = null;
try {
- for (FileStatus status : fs.listStatus
- (new Path(getPath(type) + "/" + id))) {
- in = new BufferedReader(new InputStreamReader
- (fs.open(status.getPath())));
+ for (FileStatus status : fs.listStatus(new Path(getPath(type) + "/" + id))) {
+ in = new BufferedReader(new InputStreamReader(fs.open(status.getPath())));
String line = null;
String val = "";
while ((line = in.readLine()) != null) {
@@ -152,7 +149,7 @@ public class HDFSStorage implements Temp
fs.delete(new Path(getPath(type) + "/" + id), true);
} catch (IOException e) {
throw new NotFoundException("Node " + id + " was not found: " +
- e.getMessage());
+ e.getMessage());
}
return false;
}
@@ -160,7 +157,7 @@ public class HDFSStorage implements Temp
@Override
public List<String> getAll() {
ArrayList<String> allNodes = new ArrayList<String>();
- for (Type type: Type.values()) {
+ for (Type type : Type.values()) {
allNodes.addAll(getAllForType(type));
}
return allNodes;
@@ -189,7 +186,7 @@ public class HDFSStorage implements Temp
}
} catch (Exception e) {
LOG.trace("Couldn't find children for key " + key + ": " +
- e.getMessage());
+ e.getMessage());
}
return allNodes;
}
@@ -200,7 +197,7 @@ public class HDFSStorage implements Temp
HashMap<String, String> map = new HashMap<String, String>();
try {
for (FileStatus status :
- fs.listStatus(new Path(getPath(type)))) {
+ fs.listStatus(new Path(getPath(type)))) {
map = (HashMap<String, String>)
getFields(type, status.getPath().getName());
if (map.get(key).equals(value)) {
@@ -209,7 +206,7 @@ public class HDFSStorage implements Temp
}
} catch (Exception e) {
LOG.trace("Couldn't find children for key " + key + ": " +
- e.getMessage());
+ e.getMessage());
}
return allNodes;
}
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/JobState.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/JobState.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/JobState.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/JobState.java Mon Sep 10 23:28:55 2012
@@ -43,16 +43,14 @@ public class JobState {
private Configuration config = null;
public JobState(String id, Configuration conf)
- throws IOException
- {
+ throws IOException {
this.id = id;
config = conf;
storage = getStorage(conf);
}
public void delete()
- throws IOException
- {
+ throws IOException {
try {
storage.delete(type, id);
} catch (Exception e) {
@@ -114,28 +112,26 @@ public class JobState {
/**
* The percent complete of a job
*/
- public String getPercentComplete()
- throws IOException
- {
+ public String getPercentComplete()
+ throws IOException {
return getField("percentComplete");
}
+
public void setPercentComplete(String percent)
- throws IOException
- {
+ throws IOException {
setField("percentComplete", percent);
}
/**
* The child id of TempletonControllerJob
*/
- public String getChildId()
- throws IOException
- {
+ public String getChildId()
+ throws IOException {
return getField("childid");
}
+
public void setChildId(String childid)
- throws IOException
- {
+ throws IOException {
setField("childid", childid);
}
@@ -200,13 +196,12 @@ public class JobState {
* The system exit value of the job.
*/
public Long getExitValue()
- throws IOException
- {
+ throws IOException {
return getLongField("exitValue");
}
+
public void setExitValue(long exitValue)
- throws IOException
- {
+ throws IOException {
setLongField("exitValue", exitValue);
}
@@ -214,13 +209,12 @@ public class JobState {
* When this job was created.
*/
public Long getCreated()
- throws IOException
- {
+ throws IOException {
return getLongField("created");
}
+
public void setCreated(long created)
- throws IOException
- {
+ throws IOException {
setLongField("created", created);
}
@@ -228,13 +222,12 @@ public class JobState {
* The user who started this job.
*/
public String getUser()
- throws IOException
- {
+ throws IOException {
return getField("user");
}
+
public void setUser(String user)
- throws IOException
- {
+ throws IOException {
setField("user", user);
}
@@ -242,13 +235,12 @@ public class JobState {
* The url callback
*/
public String getCallback()
- throws IOException
- {
+ throws IOException {
return getField("callback");
}
+
public void setCallback(String callback)
- throws IOException
- {
+ throws IOException {
setField("callback", callback);
}
@@ -256,13 +248,12 @@ public class JobState {
* The status of a job once it is completed.
*/
public String getCompleteStatus()
- throws IOException
- {
+ throws IOException {
return getField("completed");
}
+
public void setCompleteStatus(String complete)
- throws IOException
- {
+ throws IOException {
setField("completed", complete);
}
@@ -270,13 +261,12 @@ public class JobState {
* The time when the callback was sent.
*/
public Long getNotifiedTime()
- throws IOException
- {
+ throws IOException {
return getLongField("notified");
}
+
public void setNotifiedTime(long notified)
- throws IOException
- {
+ throws IOException {
setLongField("notified", notified);
}
@@ -288,8 +278,7 @@ public class JobState {
* Fetch an integer field from the store.
*/
public Long getLongField(String name)
- throws IOException
- {
+ throws IOException {
String s = storage.getField(type, id, name);
if (s == null)
return null;
@@ -297,7 +286,7 @@ public class JobState {
try {
return new Long(s);
} catch (NumberFormatException e) {
- LOG.error("templeton: bug " + name + " " + s + " : "+ e);
+ LOG.error("templeton: bug " + name + " " + s + " : " + e);
return null;
}
}
@@ -307,8 +296,7 @@ public class JobState {
* Store a String field from the store.
*/
public void setField(String name, String val)
- throws IOException
- {
+ throws IOException {
try {
storage.saveField(type, id, name, val);
} catch (NotFoundException ne) {
@@ -317,8 +305,7 @@ public class JobState {
}
public String getField(String name)
- throws IOException
- {
+ throws IOException {
return storage.getField(type, id, name);
}
@@ -330,13 +317,12 @@ public class JobState {
* @throws IOException
*/
public void setLongField(String name, long val)
- throws IOException
- {
+ throws IOException {
try {
storage.saveField(type, id, name, String.valueOf(val));
} catch (NotFoundException ne) {
throw new IOException("Job " + id + " was not found: " +
- ne.getMessage());
+ ne.getMessage());
}
}
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/JobStateTracker.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/JobStateTracker.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/JobStateTracker.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/JobStateTracker.java Mon Sep 10 23:28:55 2012
@@ -51,7 +51,7 @@ public class JobStateTracker {
*
*/
public JobStateTracker(String node, ZooKeeper zk, boolean nodeIsTracker,
- String job_trackingpath) {
+ String job_trackingpath) {
this.zk = zk;
if (nodeIsTracker) {
trackingnode = node;
@@ -65,13 +65,12 @@ public class JobStateTracker {
* Create the parent znode for this job state.
*/
public void create()
- throws IOException
- {
+ throws IOException {
String[] paths = ZooKeeperStorage.getPaths(job_trackingroot);
for (String znode : paths) {
try {
zk.create(znode, new byte[0],
- Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+ Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
} catch (KeeperException.NodeExistsException e) {
} catch (Exception e) {
throw new IOException("Unable to create parent nodes");
@@ -79,15 +78,14 @@ public class JobStateTracker {
}
try {
trackingnode = zk.create(makeTrackingZnode(), jobid.getBytes(),
- Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);
+ Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);
} catch (Exception e) {
throw new IOException("Unable to create " + makeTrackingZnode());
}
}
public void delete()
- throws IOException
- {
+ throws IOException {
try {
zk.delete(makeTrackingJobZnode(trackingnode), -1);
} catch (Exception e) {
@@ -103,7 +101,7 @@ public class JobStateTracker {
public String getJobID() throws IOException {
try {
return new String(zk.getData(makeTrackingJobZnode(trackingnode),
- false, new Stat()));
+ false, new Stat()));
} catch (KeeperException e) {
// It was deleted during the transaction
throw new IOException("Node already deleted " + trackingnode);
@@ -131,11 +129,11 @@ public class JobStateTracker {
* expired.
*/
public static List<String> getTrackingJobs(Configuration conf, ZooKeeper zk)
- throws IOException {
+ throws IOException {
ArrayList<String> jobs = new ArrayList<String>();
try {
for (String myid : zk.getChildren(
- conf.get(TempletonStorage.STORAGE_ROOT)
+ conf.get(TempletonStorage.STORAGE_ROOT)
+ ZooKeeperStorage.TRACKINGDIR, false)) {
jobs.add(myid);
}
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/NullRecordReader.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/NullRecordReader.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/NullRecordReader.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/NullRecordReader.java Mon Sep 10 23:28:55 2012
@@ -18,6 +18,7 @@
package org.apache.hcatalog.templeton.tool;
import java.io.IOException;
+
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.RecordReader;
@@ -27,15 +28,15 @@ import org.apache.hadoop.mapreduce.TaskA
* An empty record reader.
*/
public class NullRecordReader
- extends RecordReader<NullWritable, NullWritable>
-{
+ extends RecordReader<NullWritable, NullWritable> {
@Override
public void initialize(InputSplit genericSplit, TaskAttemptContext context)
- throws IOException
- {}
+ throws IOException {
+ }
@Override
- public void close() throws IOException {}
+ public void close() throws IOException {
+ }
@Override
public NullWritable getCurrentKey() {
@@ -48,7 +49,9 @@ public class NullRecordReader
}
@Override
- public float getProgress() { return 1.0f; }
+ public float getProgress() {
+ return 1.0f;
+ }
@Override
public boolean nextKeyValue() throws IOException {
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/SingleInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/SingleInputFormat.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/SingleInputFormat.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/SingleInputFormat.java Mon Sep 10 23:28:55 2012
@@ -20,6 +20,7 @@ package org.apache.hcatalog.templeton.to
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.InputFormat;
import org.apache.hadoop.mapreduce.InputSplit;
@@ -31,21 +32,18 @@ import org.apache.hadoop.mapreduce.TaskA
* An empty InputFormat.
*/
public class SingleInputFormat
- extends InputFormat<NullWritable, NullWritable>
-{
+ extends InputFormat<NullWritable, NullWritable> {
public List<InputSplit> getSplits(JobContext job)
- throws IOException
- {
+ throws IOException {
List<InputSplit> res = new ArrayList<InputSplit>();
res.add(new NullSplit());
return res;
}
public RecordReader<NullWritable, NullWritable>
- createRecordReader(InputSplit split,
- TaskAttemptContext context)
- throws IOException
- {
+ createRecordReader(InputSplit split,
+ TaskAttemptContext context)
+ throws IOException {
return new NullRecordReader();
}
}
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonControllerJob.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonControllerJob.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonControllerJob.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonControllerJob.java Mon Sep 10 23:28:55 2012
@@ -66,32 +66,32 @@ import org.apache.hadoop.mapreduce.secur
* in hdfs files.
*/
public class TempletonControllerJob extends Configured implements Tool {
- static enum ControllerCounters { SIMPLE_COUNTER };
+ static enum ControllerCounters {SIMPLE_COUNTER}
- public static final String COPY_NAME = "templeton.copy";
+ ;
+
+ public static final String COPY_NAME = "templeton.copy";
public static final String STATUSDIR_NAME = "templeton.statusdir";
- public static final String JAR_ARGS_NAME = "templeton.args";
+ public static final String JAR_ARGS_NAME = "templeton.args";
public static final String OVERRIDE_CLASSPATH = "templeton.override-classpath";
- public static final String STDOUT_FNAME = "stdout";
- public static final String STDERR_FNAME = "stderr";
- public static final String EXIT_FNAME = "exit";
+ public static final String STDOUT_FNAME = "stdout";
+ public static final String STDERR_FNAME = "stderr";
+ public static final String EXIT_FNAME = "exit";
public static final int WATCHER_TIMEOUT_SECS = 10;
- public static final int KEEP_ALIVE_MSEC = 60 * 1000;
+ public static final int KEEP_ALIVE_MSEC = 60 * 1000;
private static TrivialExecService execService = TrivialExecService.getInstance();
private static final Log LOG = LogFactory.getLog(TempletonControllerJob.class);
-
-
+
+
public static class LaunchMapper
- extends Mapper<NullWritable, NullWritable, Text, Text>
- {
+ extends Mapper<NullWritable, NullWritable, Text, Text> {
protected Process startJob(Context context, String user,
String overrideClasspath)
- throws IOException, InterruptedException
- {
+ throws IOException, InterruptedException {
Configuration conf = context.getConfiguration();
copyLocal(COPY_NAME, conf);
String[] jarArgs
@@ -100,18 +100,17 @@ public class TempletonControllerJob exte
ArrayList<String> removeEnv = new ArrayList<String>();
removeEnv.add("HADOOP_ROOT_LOGGER");
Map<String, String> env = TempletonUtils.hadoopUserEnv(user,
- overrideClasspath);
+ overrideClasspath);
List<String> jarArgsList = new LinkedList<String>(Arrays.asList(jarArgs));
String tokenFile = System.getenv("HADOOP_TOKEN_FILE_LOCATION");
- if(tokenFile != null){
- jarArgsList.add(1, "-Dmapreduce.job.credentials.binary=" + tokenFile );
+ if (tokenFile != null) {
+ jarArgsList.add(1, "-Dmapreduce.job.credentials.binary=" + tokenFile);
}
return execService.run(jarArgsList, removeEnv, env);
}
private void copyLocal(String var, Configuration conf)
- throws IOException
- {
+ throws IOException {
String[] filenames = TempletonUtils.decodeArray(conf.get(var));
if (filenames != null) {
for (String filename : filenames) {
@@ -126,29 +125,28 @@ public class TempletonControllerJob exte
@Override
public void run(Context context)
- throws IOException, InterruptedException
- {
+ throws IOException, InterruptedException {
Configuration conf = context.getConfiguration();
Process proc = startJob(context,
- conf.get("user.name"),
- conf.get(OVERRIDE_CLASSPATH));
+ conf.get("user.name"),
+ conf.get(OVERRIDE_CLASSPATH));
String statusdir = conf.get(STATUSDIR_NAME);
Counter cnt = context.getCounter(ControllerCounters.SIMPLE_COUNTER);
ExecutorService pool = Executors.newCachedThreadPool();
executeWatcher(pool, conf, context.getJobID(),
- proc.getInputStream(), statusdir, STDOUT_FNAME);
+ proc.getInputStream(), statusdir, STDOUT_FNAME);
executeWatcher(pool, conf, context.getJobID(),
- proc.getErrorStream(), statusdir, STDERR_FNAME);
+ proc.getErrorStream(), statusdir, STDERR_FNAME);
KeepAlive keepAlive = startCounterKeepAlive(pool, cnt);
proc.waitFor();
keepAlive.sendReport = false;
pool.shutdown();
- if (! pool.awaitTermination(WATCHER_TIMEOUT_SECS, TimeUnit.SECONDS))
+ if (!pool.awaitTermination(WATCHER_TIMEOUT_SECS, TimeUnit.SECONDS))
pool.shutdownNow();
writeExitValue(conf, proc.exitValue(), statusdir);
@@ -159,7 +157,7 @@ public class TempletonControllerJob exte
if (proc.exitValue() != 0)
System.err.println("templeton: job failed with exit code "
- + proc.exitValue());
+ + proc.exitValue());
else
System.err.println("templeton: job completed with exit code 0");
}
@@ -167,29 +165,26 @@ public class TempletonControllerJob exte
private void executeWatcher(ExecutorService pool, Configuration conf,
JobID jobid, InputStream in, String statusdir,
String name)
- throws IOException
- {
+ throws IOException {
Watcher w = new Watcher(conf, jobid, in, statusdir, name);
pool.execute(w);
}
private KeepAlive startCounterKeepAlive(ExecutorService pool, Counter cnt)
- throws IOException
- {
+ throws IOException {
KeepAlive k = new KeepAlive(cnt);
pool.execute(k);
return k;
}
private void writeExitValue(Configuration conf, int exitValue, String statusdir)
- throws IOException
- {
+ throws IOException {
if (TempletonUtils.isset(statusdir)) {
Path p = new Path(statusdir, EXIT_FNAME);
FileSystem fs = p.getFileSystem(conf);
OutputStream out = fs.create(p);
System.err.println("templeton: Writing exit value "
- + exitValue + " to " + p);
+ + exitValue + " to " + p);
PrintWriter writer = new PrintWriter(out);
writer.println(exitValue);
writer.close();
@@ -205,8 +200,7 @@ public class TempletonControllerJob exte
public Watcher(Configuration conf, JobID jobid, InputStream in,
String statusdir, String name)
- throws IOException
- {
+ throws IOException {
this.conf = conf;
this.jobid = jobid;
this.in = in;
@@ -266,8 +260,7 @@ public class TempletonControllerJob exte
private Counter cnt;
public boolean sendReport;
- public KeepAlive(Counter cnt)
- {
+ public KeepAlive(Counter cnt) {
this.cnt = cnt;
this.sendReport = true;
}
@@ -286,6 +279,7 @@ public class TempletonControllerJob exte
}
private JobID submittedJobId;
+
public String getSubmittedId() {
if (submittedJobId == null)
return null;
@@ -298,8 +292,7 @@ public class TempletonControllerJob exte
*/
@Override
public int run(String[] args)
- throws IOException, InterruptedException, ClassNotFoundException
- {
+ throws IOException, InterruptedException, ClassNotFoundException {
Configuration conf = getConf();
conf.set(JAR_ARGS_NAME, TempletonUtils.encodeArray(args));
conf.set("user.name", UserGroupInformation.getCurrentUser().getShortUserName());
@@ -314,9 +307,9 @@ public class TempletonControllerJob exte
= new NullOutputFormat<NullWritable, NullWritable>();
job.setOutputFormatClass(of.getClass());
job.setNumReduceTasks(0);
-
+
JobClient jc = new JobClient(new JobConf(job.getConfiguration()));
-
+
Token<DelegationTokenIdentifier> mrdt = jc.getDelegationToken(new Text("mr token"));
job.getCredentials().addToken(new Text("mr token"), mrdt);
job.submit();
@@ -326,7 +319,7 @@ public class TempletonControllerJob exte
return 0;
}
-
+
public static void main(String[] args) throws Exception {
int ret = ToolRunner.run(new TempletonControllerJob(), args);
if (ret != 0)
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java Mon Sep 10 23:28:55 2012
@@ -30,6 +30,7 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
@@ -65,14 +66,14 @@ public class TempletonUtils {
* Is the object non-empty?
*/
public static <T> boolean isset(Collection<T> col) {
- return (col != null) && (! col.isEmpty());
+ return (col != null) && (!col.isEmpty());
}
/**
* Is the object non-empty?
*/
public static <K, V> boolean isset(Map<K, V> col) {
- return (col != null) && (! col.isEmpty());
+ return (col != null) && (!col.isEmpty());
}
@@ -160,8 +161,7 @@ public class TempletonUtils {
public static String[] hadoopFsListAsArray(String files, Configuration conf,
String user)
throws URISyntaxException, FileNotFoundException, IOException,
- InterruptedException
- {
+ InterruptedException {
if (files == null || conf == null) {
return null;
}
@@ -177,8 +177,7 @@ public class TempletonUtils {
public static String hadoopFsListAsString(String files, Configuration conf,
String user)
throws URISyntaxException, FileNotFoundException, IOException,
- InterruptedException
- {
+ InterruptedException {
if (files == null || conf == null) {
return null;
}
@@ -187,8 +186,7 @@ public class TempletonUtils {
public static String hadoopFsFilename(String fname, Configuration conf, String user)
throws URISyntaxException, FileNotFoundException, IOException,
- InterruptedException
- {
+ InterruptedException {
Path p = hadoopFsPath(fname, conf, user);
if (p == null)
return null;
@@ -201,8 +199,8 @@ public class TempletonUtils {
*/
public static boolean hadoopFsIsMissing(FileSystem fs, Path p) {
try {
- return ! fs.exists(p);
- } catch(Throwable t) {
+ return !fs.exists(p);
+ } catch (Throwable t) {
// Got an error, might be there anyway due to a
// permissions problem.
return false;
@@ -211,8 +209,7 @@ public class TempletonUtils {
public static Path hadoopFsPath(String fname, Configuration conf, String user)
throws URISyntaxException, FileNotFoundException, IOException,
- InterruptedException
- {
+ InterruptedException {
if (fname == null || conf == null) {
return null;
}
@@ -231,8 +228,7 @@ public class TempletonUtils {
* GET the given url. Returns the number of bytes received.
*/
public static int fetchUrl(URL url)
- throws IOException
- {
+ throws IOException {
URLConnection cnx = url.openConnection();
InputStream in = cnx.getInputStream();
@@ -249,8 +245,7 @@ public class TempletonUtils {
* Set the environment variables to specify the hadoop user.
*/
public static Map<String, String> hadoopUserEnv(String user,
- String overrideClasspath)
- {
+ String overrideClasspath) {
HashMap<String, String> env = new HashMap<String, String>();
env.put("HADOOP_USER_NAME", user);
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TrivialExecService.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TrivialExecService.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TrivialExecService.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TrivialExecService.java Mon Sep 10 23:28:55 2012
@@ -39,11 +39,10 @@ public class TrivialExecService {
public Process run(List<String> cmd, List<String> removeEnv,
Map<String, String> environmentVariables)
- throws IOException
- {
+ throws IOException {
System.err.println("templeton: starting " + cmd);
- System.err.print("With environment variables: " );
- for(Map.Entry<String, String> keyVal : environmentVariables.entrySet()){
+ System.err.print("With environment variables: ");
+ for (Map.Entry<String, String> keyVal : environmentVariables.entrySet()) {
System.err.println(keyVal.getKey() + "=" + keyVal.getValue());
}
ProcessBuilder pb = new ProcessBuilder(cmd);
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/ZooKeeperCleanup.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/ZooKeeperCleanup.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/ZooKeeperCleanup.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/ZooKeeperCleanup.java Mon Sep 10 23:28:55 2012
@@ -77,7 +77,7 @@ public class ZooKeeperCleanup extends Th
}
public static void startInstance(Configuration appConf) throws IOException {
- if (! isRunning) {
+ if (!isRunning) {
getInstance(appConf).start();
}
}
@@ -122,7 +122,7 @@ public class ZooKeeperCleanup extends Th
long sleepMillis = (long) (Math.random() * interval);
LOG.info("Next execution: " + new Date(new Date().getTime()
- + sleepMillis));
+ + sleepMillis));
Thread.sleep(sleepMillis);
} catch (Exception e) {
@@ -157,8 +157,8 @@ public class ZooKeeperCleanup extends Th
JobState state = null;
try {
JobStateTracker tracker = new JobStateTracker(node, zk, true,
- appConf.get(TempletonStorage.STORAGE_ROOT +
- ZooKeeperStorage.TRACKINGDIR));
+ appConf.get(TempletonStorage.STORAGE_ROOT +
+ ZooKeeperStorage.TRACKINGDIR));
long now = new Date().getTime();
state = new JobState(tracker.getJobID(), appConf);
Modified: incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/ZooKeeperStorage.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/ZooKeeperStorage.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/ZooKeeperStorage.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/ZooKeeperStorage.java Mon Sep 10 23:28:55 2012
@@ -65,25 +65,23 @@ public class ZooKeeperStorage implements
* Open a ZooKeeper connection for the JobState.
*/
public static ZooKeeper zkOpen(String zkHosts, int zkSessionTimeout)
- throws IOException
- {
+ throws IOException {
return new ZooKeeper(zkHosts,
- zkSessionTimeout,
- new Watcher() {
- @Override
- synchronized public void process(WatchedEvent event) {
- }
- });
+ zkSessionTimeout,
+ new Watcher() {
+ @Override
+ synchronized public void process(WatchedEvent event) {
+ }
+ });
}
/**
* Open a ZooKeeper connection for the JobState.
*/
public static ZooKeeper zkOpen(Configuration conf)
- throws IOException
- {
+ throws IOException {
return zkOpen(conf.get(ZK_HOSTS),
- conf.getInt(ZK_SESSION_TIMEOUT, 30000));
+ conf.getInt(ZK_SESSION_TIMEOUT, 30000));
}
public ZooKeeperStorage() {
@@ -95,8 +93,7 @@ public class ZooKeeperStorage implements
* Close this ZK connection.
*/
public void close()
- throws IOException
- {
+ throws IOException {
if (zk != null) {
try {
zk.close();
@@ -119,15 +116,14 @@ public class ZooKeeperStorage implements
* Create a node in ZooKeeper
*/
public void create(Type type, String id)
- throws IOException
- {
+ throws IOException {
try {
String[] paths = getPaths(makeZnode(type, id));
boolean wasCreated = false;
for (String znode : paths) {
try {
zk.create(znode, new byte[0],
- Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
+ Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
wasCreated = true;
} catch (KeeperException.NodeExistsException e) {
}
@@ -138,7 +134,7 @@ public class ZooKeeperStorage implements
// to see how the storage mechanism evolves.
if (type.equals(Type.JOB)) {
JobStateTracker jt = new JobStateTracker(id, zk, false,
- job_trackingpath);
+ job_trackingpath);
jt.create();
}
} catch (Exception e) {
@@ -153,7 +149,7 @@ public class ZooKeeperStorage implements
if (wasCreated) {
try {
saveField(type, id, "created",
- Long.toString(System.currentTimeMillis()));
+ Long.toString(System.currentTimeMillis()));
} catch (NotFoundException nfe) {
// Wow, something's really wrong.
throw new IOException("Couldn't write to node " + id, nfe);
@@ -210,17 +206,16 @@ public class ZooKeeperStorage implements
* @throws InterruptedException
*/
private void setFieldData(Type type, String id, String name, String val)
- throws KeeperException, UnsupportedEncodingException, InterruptedException
- {
+ throws KeeperException, UnsupportedEncodingException, InterruptedException {
try {
zk.create(makeFieldZnode(type, id, name),
- val.getBytes(ENCODING),
- Ids.OPEN_ACL_UNSAFE,
- CreateMode.PERSISTENT);
- } catch(KeeperException.NodeExistsException e) {
+ val.getBytes(ENCODING),
+ Ids.OPEN_ACL_UNSAFE,
+ CreateMode.PERSISTENT);
+ } catch (KeeperException.NodeExistsException e) {
zk.setData(makeFieldZnode(type, id, name),
- val.getBytes(ENCODING),
- -1);
+ val.getBytes(ENCODING),
+ -1);
}
}
@@ -246,9 +241,9 @@ public class ZooKeeperStorage implements
create(type, id);
setFieldData(type, id, key, val);
}
- } catch(Exception e) {
+ } catch (Exception e) {
throw new NotFoundException("Writing " + key + ": " + val + ", "
- + e.getMessage());
+ + e.getMessage());
}
}
@@ -257,7 +252,7 @@ public class ZooKeeperStorage implements
try {
byte[] b = zk.getData(makeFieldZnode(type, id, key), false, null);
return new String(b, ENCODING);
- } catch(Exception e) {
+ } catch (Exception e) {
return null;
}
}
@@ -266,12 +261,12 @@ public class ZooKeeperStorage implements
public Map<String, String> getFields(Type type, String id) {
HashMap<String, String> map = new HashMap<String, String>();
try {
- for (String node: zk.getChildren(makeZnode(type, id), false)) {
+ for (String node : zk.getChildren(makeZnode(type, id), false)) {
byte[] b = zk.getData(makeFieldZnode(type, id, node),
- false, null);
+ false, null);
map.put(node, new String(b, ENCODING));
}
- } catch(Exception e) {
+ } catch (Exception e) {
return map;
}
return map;
@@ -287,7 +282,7 @@ public class ZooKeeperStorage implements
// Other nodes may be trying to delete this at the same time,
// so just log errors and skip them.
throw new NotFoundException("Couldn't delete " +
- makeFieldZnode(type, id, child));
+ makeFieldZnode(type, id, child));
}
}
try {
@@ -295,12 +290,12 @@ public class ZooKeeperStorage implements
} catch (Exception e) {
// Same thing -- might be deleted by other nodes, so just go on.
throw new NotFoundException("Couldn't delete " +
- makeZnode(type, id));
+ makeZnode(type, id));
}
} catch (Exception e) {
// Error getting children of node -- probably node has been deleted
throw new NotFoundException("Couldn't get children of " +
- makeZnode(type, id));
+ makeZnode(type, id));
}
return true;
}
@@ -308,7 +303,7 @@ public class ZooKeeperStorage implements
@Override
public List<String> getAll() {
ArrayList<String> allNodes = new ArrayList<String>();
- for (Type type: Type.values()) {
+ for (Type type : Type.values()) {
allNodes.addAll(getAllForType(type));
}
return allNodes;
@@ -327,7 +322,7 @@ public class ZooKeeperStorage implements
public List<String> getAllForKey(String key, String value) {
ArrayList<String> allNodes = new ArrayList<String>();
try {
- for (Type type: Type.values()) {
+ for (Type type : Type.values()) {
allNodes.addAll(getAllForTypeAndKey(type, key, value));
}
} catch (Exception e) {
Modified: incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/mock/MockServer.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/mock/MockServer.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/mock/MockServer.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/mock/MockServer.java Mon Sep 10 23:28:55 2012
@@ -24,6 +24,7 @@ import org.apache.hcatalog.templeton.Ser
*/
public class MockServer extends Server {
public String user;
+
public MockServer() {
execService = new MockExecService();
resetUser();
Modified: incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/tool/TestTempletonUtils.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/tool/TestTempletonUtils.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/tool/TestTempletonUtils.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/tool/TestTempletonUtils.java Mon Sep 10 23:28:55 2012
@@ -183,7 +183,7 @@ public class TestTempletonUtils {
Assert.assertTrue(TempletonUtils.hadoopFsListAsString("/tmp,/usr",
null, null) == null);
Assert.assertEquals("file:/tmp,file:/usr", TempletonUtils.hadoopFsListAsString
- ("/tmp,/usr", new Configuration(), null));
+ ("/tmp,/usr", new Configuration(), null));
} catch (FileNotFoundException e) {
Assert.fail("Couldn't find name for /tmp");
} catch (Exception e) {
Modified: incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/tool/TestTrivialExecService.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/tool/TestTrivialExecService.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/tool/TestTrivialExecService.java (original)
+++ incubator/hcatalog/trunk/webhcat/svr/src/test/java/org/apache/hcatalog/templeton/tool/TestTrivialExecService.java Mon Sep 10 23:28:55 2012
@@ -36,17 +36,17 @@ public class TestTrivialExecService {
try {
Process process = TrivialExecService.getInstance()
.run(list,
- new ArrayList<String>(),
- new HashMap<String, String>());
+ new ArrayList<String>(),
+ new HashMap<String, String>());
out = new BufferedReader(new InputStreamReader(
- process.getInputStream()));
+ process.getInputStream()));
err = new BufferedReader(new InputStreamReader(
- process.getErrorStream()));
+ process.getErrorStream()));
Assert.assertEquals("success", out.readLine());
out.close();
String line;
while ((line = err.readLine()) != null) {
- Assert.fail(line);
+ Assert.fail(line);
}
process.waitFor();
} catch (Exception e) {