You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2008/10/09 10:50:56 UTC
svn commit: r703105 - in /incubator/hama/trunk/src/java/org/apache/hama:
AbstractMatrix.java HamaAdmin.java
Author: edwardyoon
Date: Thu Oct 9 01:50:55 2008
New Revision: 703105
URL: http://svn.apache.org/viewvc?rev=703105&view=rev
Log: (empty)
Modified:
incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java
incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java
Modified: incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java?rev=703105&r1=703104&r2=703105&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/AbstractMatrix.java Thu Oct 9 01:50:55 2008
@@ -153,10 +153,15 @@
}
public void close() throws IOException {
- admin.deleteTable(matrixName);
+ if(admin.isTableEnabled(matrixName)) {
+ admin.disableTable(matrixName);
+ admin.deleteTable(matrixName);
+ } else {
+ LOG.info("Table doesn't abled");
+ }
}
- public boolean save(String path) throws IOException {
- return hAdmin.put(this.matrixName, path);
+ public boolean save(String name) throws IOException {
+ return hAdmin.put(this.matrixName, name);
}
}
Modified: incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java?rev=703105&r1=703104&r2=703105&view=diff
==============================================================================
--- incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java (original)
+++ incubator/hama/trunk/src/java/org/apache/hama/HamaAdmin.java Thu Oct 9 01:50:55 2008
@@ -61,10 +61,10 @@
}
}
- public boolean put(String matrixName, String path) {
+ public boolean put(String matrixName, String name) {
boolean result = false;
- BatchUpdate update = new BatchUpdate(path);
+ BatchUpdate update = new BatchUpdate(name);
update.put(Constants.PATHCOLUMN, Bytes.toBytes(matrixName));
try {
table.commit(update);
@@ -76,9 +76,13 @@
return result;
}
- public String get(String path) {
+ /**
+ * @param name
+ * @return real table name
+ */
+ public String get(String name) {
try {
- byte[] result = table.get(path, Constants.PATHCOLUMN).getValue();
+ byte[] result = table.get(name, Constants.PATHCOLUMN).getValue();
return Bytes.toString(result);
} catch (IOException e) {
e.printStackTrace();