Skip to content

Commit

Permalink
Refactor static variable name to match convention
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinjia committed Dec 16, 2013
1 parent 98d8ea1 commit 21fa09d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/java/tachyon/Dependency.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public synchronized String getCommand() {

public String parseCommandPrefix() {
String rtn = COMMAND_PREFIX;
for (String s : RecomputeVariables._recomputeVars.keySet()) {
rtn = rtn.replace("$" + s, RecomputeVariables._recomputeVars.get(s));
for (String s : RecomputeVariables.sRecomputeVars.keySet()) {
rtn = rtn.replace("$" + s, RecomputeVariables.sRecomputeVars.get(s));
}
return rtn;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tachyon/RecomputeVariables.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
import java.util.Hashtable;

public class RecomputeVariables {
public static Hashtable<String, String> _recomputeVars = new Hashtable<String, String>();
public static Hashtable<String, String> sRecomputeVars = new Hashtable<String, String>();
}
6 changes: 3 additions & 3 deletions src/main/java/tachyon/web/WebInterfaceGeneralServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
RecomputeVariables._recomputeVars.clear();
RecomputeVariables.sRecomputeVars.clear();
for (String key : (Set<String>) request.getParameterMap().keySet()) {
if (key.startsWith("varName")) {
String value = request.getParameter("varVal" + key.substring(7));
if (value != null) {
RecomputeVariables._recomputeVars.put(request.getParameter(key), value);
RecomputeVariables.sRecomputeVars.put(request.getParameter(key), value);
}
}
}
Expand Down Expand Up @@ -166,7 +166,7 @@ private void populateValues(HttpServletRequest request) throws IOException {
request.setAttribute("diskFreeCapacity", "UNKNOWN");
}

request.setAttribute("recomputeVariables", RecomputeVariables._recomputeVars);
request.setAttribute("recomputeVariables", RecomputeVariables.sRecomputeVars);

List<ClientWorkerInfo> workerInfos = mMasterInfo.getWorkersInfo();
for (int i = 0; i < workerInfos.size(); i ++) {
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/tachyon/DependencyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public class DependencyTest {
public final void before() throws IOException {
mLocalTachyonCluster = new LocalTachyonCluster(10000);
mLocalTachyonCluster.start();
RecomputeVariables._recomputeVars.put("master", mMasterValue);
RecomputeVariables._recomputeVars.put("port", mPortValue);
RecomputeVariables.sRecomputeVars.put("master", mMasterValue);
RecomputeVariables.sRecomputeVars.put("port", mPortValue);
}

@After
public final void after() throws Exception {
RecomputeVariables._recomputeVars.clear();
RecomputeVariables.sRecomputeVars.clear();
mLocalTachyonCluster.stop();
}

Expand Down

0 comments on commit 21fa09d

Please sign in to comment.