hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r933344 - in /hadoop/hbase/branches/0.20_pre_durability: ./ lib/ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/io/ src/java/org/apache/hadoop/hbase/rest/ src/java/org/apache/hadoop/hbase/rest/descriptors/ src/java/org/a...
Date Mon, 12 Apr 2010 18:17:16 GMT
Author: stack
Date: Mon Apr 12 18:17:15 2010
New Revision: 933344

URL: http://svn.apache.org/viewvc?rev=933344&view=rev
Log:
HBASE-2383 Replace JSON-licensed json dependencies

Removed:
    hadoop/hbase/branches/0.20_pre_durability/lib/AgileJSON-2009-03-30.jar
    hadoop/hbase/branches/0.20_pre_durability/lib/json.jar
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/parser/JsonRestParser.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/serializer/JSONSerializer.java
Modified:
    hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/Cell.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/RowResult.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/DatabaseModel.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/Status.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/TableModel.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/RestCell.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/ScannerIdentifier.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/exception/HBaseRestException.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/ColumnValueFilterFactory.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/RowFilterSetFactory.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/WhileMatchRowFilterFactory.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/parser/HBaseRestParserFactory.java
    hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/serializer/RestSerializerFactory.java
    hadoop/hbase/branches/0.20_pre_durability/src/webapps/rest/WEB-INF/web.xml

Modified: hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt Mon Apr 12 18:17:15 2010
@@ -40,6 +40,7 @@ Release 0.20.4 - Unreleased
    HBASE-2417  HCM.locateRootRegion fails hard on "Connection refused"
    HBASE-2346  Usage of FilterList slows down scans
    HBASE-2402  [stargate] set maxVersions on gets
+   HBASE-2383  Replace JSON-licensed json dependencies
 
   IMPROVEMENTS
    HBASE-2180  Bad read performance from synchronizing hfile.fddatainputstream

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java
Mon Apr 12 18:17:15 2010
@@ -36,8 +36,6 @@ import org.apache.hadoop.hbase.util.Byte
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.WritableComparable;
 
-import agilejson.TOJSON;
-
 /**
  * An HColumnDescriptor contains information about a column family such as the
  * number of versions, compression settings, etc.
@@ -331,7 +329,6 @@ public class HColumnDescriptor implement
   /**
    * @return Name of this column family with colon as required by client API
    */
-  @TOJSON(fieldName = "name", base64=true)
   public byte [] getNameWithColon() {
     return Bytes.add(this.name, new byte[]{':'});
   }
@@ -397,14 +394,12 @@ public class HColumnDescriptor implement
   }
 
   /** @return compression type being used for the column family */
-  @TOJSON
   public Compression.Algorithm getCompression() {
     String n = getValue(COMPRESSION);
     return Compression.Algorithm.valueOf(n.toUpperCase());
   }
   
   /** @return maximum number of versions */
-  @TOJSON
   public synchronized int getMaxVersions() {
     if (this.cachedMaxVersions == -1) {
       String value = getValue(HConstants.VERSIONS);
@@ -424,7 +419,6 @@ public class HColumnDescriptor implement
   /**
    * @return Blocksize.
    */
-  @TOJSON
   public synchronized int getBlocksize() {
     if (this.blocksize == null) {
       String value = getValue(BLOCKSIZE);
@@ -445,7 +439,6 @@ public class HColumnDescriptor implement
   /**
    * @return Compression type setting.
    */
-  @TOJSON
   public Compression.Algorithm getCompressionType() {
     return getCompression();
   }
@@ -470,7 +463,6 @@ public class HColumnDescriptor implement
   /**
    * @return True if we are to keep all in use HRegionServer cache.
    */
-  @TOJSON(prefixLength = 2)
   public boolean isInMemory() {
     String value = getValue(HConstants.IN_MEMORY);
     if (value != null)
@@ -489,7 +481,6 @@ public class HColumnDescriptor implement
   /**
    * @return Time-to-live of cell contents, in seconds.
    */
-  @TOJSON
   public int getTimeToLive() {
     String value = getValue(TTL);
     return (value != null)? Integer.valueOf(value).intValue(): DEFAULT_TTL;
@@ -505,7 +496,6 @@ public class HColumnDescriptor implement
   /**
    * @return True if MapFile blocks should be cached.
    */
-  @TOJSON(prefixLength = 2)
   public boolean isBlockCacheEnabled() {
     String value = getValue(BLOCKCACHE);
     if (value != null)
@@ -523,7 +513,6 @@ public class HColumnDescriptor implement
   /**
    * @return true if a bloom filter is enabled
    */
-  @TOJSON(prefixLength = 2)
   public boolean isBloomfilter() {
     String value = getValue(BLOOMFILTER);
     if (value != null)

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HTableDescriptor.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
Mon Apr 12 18:17:15 2010
@@ -39,8 +39,6 @@ import org.apache.hadoop.hbase.rest.seri
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.WritableComparable;
 
-import agilejson.TOJSON;
-
 /**
  * HTableDescriptor contains the name of an HTable, and its
  * column families.
@@ -373,7 +371,6 @@ ISerializable {
   }
 
   /** @return name of table */
-  @TOJSON
   public byte [] getName() {
     return name;
   }
@@ -611,8 +608,7 @@ ISerializable {
   public Set<byte[]> getFamiliesKeys() {
     return Collections.unmodifiableSet(this.families.keySet());
   }
-  
-  @TOJSON(fieldName = "columns")
+
   public HColumnDescriptor[] getColumnFamilies() {
     return getFamilies().toArray(new HColumnDescriptor[0]);
   }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/Cell.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/Cell.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/Cell.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/Cell.java
Mon Apr 12 18:17:15 2010
@@ -39,8 +39,6 @@ import org.apache.hadoop.hbase.rest.seri
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.Writable;
 
-import agilejson.TOJSON;
-
 /**
  * Cell - Used to transport a cell value (byte[]) and the timestamp it was
  * stored with together as a result for get and getRow methods. This promotes
@@ -119,13 +117,11 @@ public class Cell implements Writable, I
   }
 
   /** @return the current cell's value */
-  @TOJSON(base64=true)
   public byte[] getValue() {
     return valueMap.get(valueMap.firstKey());
   }
 
   /** @return the current cell's timestamp */
-  @TOJSON
   public long getTimestamp() {
     return valueMap.firstKey();
   }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/RowResult.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/RowResult.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/RowResult.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/io/RowResult.java
Mon Apr 12 18:17:15 2010
@@ -41,8 +41,6 @@ import org.apache.hadoop.hbase.util.Byte
 import org.apache.hadoop.hbase.util.Writables;
 import org.apache.hadoop.io.Writable;
 
-import agilejson.TOJSON;
-
 /**
  * Holds row name and then a map of columns to cells.
  * @deprecated As of hbase 0.20.0, replaced by new Get/Put/Delete/Result-based API.
@@ -73,7 +71,6 @@ public class RowResult implements Writab
    * Get the row for this RowResult
    * @return the row
    */
-  @TOJSON(base64=true)
   public byte [] getRow() {
     return row;
   }
@@ -145,7 +142,6 @@ public class RowResult implements Writab
    * 
    * @return Cells
    */
-  @TOJSON
   public RestCell[] getCells() {
     RestCell[] restCells = new RestCell[this.cells.size()];
     int i = 0;

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/DatabaseModel.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/DatabaseModel.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/DatabaseModel.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/DatabaseModel.java
Mon Apr 12 18:17:15 2010
@@ -30,8 +30,6 @@ import org.apache.hadoop.hbase.rest.exce
 import org.apache.hadoop.hbase.rest.serializer.IRestSerializer;
 import org.apache.hadoop.hbase.rest.serializer.ISerializable;
 
-import agilejson.TOJSON;
-
 public class DatabaseModel extends AbstractModel {
 
   @SuppressWarnings("unused")
@@ -50,12 +48,10 @@ public class DatabaseModel extends Abstr
       tables = a.listTables();
     }
 
-    @TOJSON(prefixLength = 2)
     public boolean isMasterRunning() {
       return master_running;
     }
 
-    @TOJSON
     public HTableDescriptor[] getTables() {
       return tables;
     }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/Status.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/Status.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/Status.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/Status.java
Mon Apr 12 18:17:15 2010
@@ -31,8 +31,6 @@ import org.apache.hadoop.hbase.rest.seri
 import org.apache.hadoop.hbase.rest.serializer.ISerializable;
 import org.apache.hadoop.hbase.util.Bytes;
 
-import agilejson.TOJSON;
-
 public class Status {
 
   @SuppressWarnings("unused")
@@ -108,7 +106,6 @@ public class Status {
     return statusCode;
   }
 
-  @TOJSON
   public Object getMessage() {
     return message;
   }
@@ -124,17 +121,14 @@ public class Status {
       reason = o;
     }
 
-    @TOJSON
     public int getStatusCode() {
       return statusCode;
     }
 
-    @TOJSON
     public boolean getError() {
       return error;
     }
 
-    @TOJSON
     public Object getMessage() {
       return reason;
     }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/TableModel.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/TableModel.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/TableModel.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/TableModel.java
Mon Apr 12 18:17:15 2010
@@ -37,8 +37,6 @@ import org.apache.hadoop.hbase.rest.seri
 import org.apache.hadoop.hbase.rest.serializer.ISerializable;
 import org.apache.hadoop.hbase.util.Bytes;
 
-import agilejson.TOJSON;
-
 public class TableModel extends AbstractModel {
 
   @SuppressWarnings("unused")
@@ -256,7 +254,6 @@ public class TableModel extends Abstract
     /**
      * @return the regionKey
      */
-    @TOJSON(fieldName = "region")
     public byte[][] getRegionKey() {
       return regionKey;
     }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/RestCell.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/RestCell.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/RestCell.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/RestCell.java
Mon Apr 12 18:17:15 2010
@@ -21,8 +21,6 @@ package org.apache.hadoop.hbase.rest.des
 
 import org.apache.hadoop.hbase.io.Cell;
 
-import agilejson.TOJSON;
-
 /**
  * 
  */
@@ -88,7 +86,6 @@ public class RestCell extends Cell {
   /**
    * @return the name
    */
-  @TOJSON(base64=true)
   public byte[] getName() {
     return name;
   }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/ScannerIdentifier.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/ScannerIdentifier.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/ScannerIdentifier.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/descriptors/ScannerIdentifier.java
Mon Apr 12 18:17:15 2010
@@ -23,8 +23,6 @@ import org.apache.hadoop.hbase.rest.exce
 import org.apache.hadoop.hbase.rest.serializer.IRestSerializer;
 import org.apache.hadoop.hbase.rest.serializer.ISerializable;
 
-import agilejson.TOJSON;
-
 /**
  * 
  */
@@ -53,7 +51,6 @@ public class ScannerIdentifier implement
   /**
    * @return the id
    */
-  @TOJSON
   public Integer getId() {
     return id;
   }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/exception/HBaseRestException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/exception/HBaseRestException.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/exception/HBaseRestException.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/exception/HBaseRestException.java
Mon Apr 12 18:17:15 2010
@@ -19,8 +19,6 @@
  */
 package org.apache.hadoop.hbase.rest.exception;
 
-import agilejson.TOJSON;
-
 public class HBaseRestException extends Exception {
 
   /**
@@ -59,12 +57,10 @@ public class HBaseRestException extends 
     innerMessage = message;
   }
 
-  @TOJSON
   public String getInnerClass() {
     return this.innerClass;
   }
 
-  @TOJSON
   public String getInnerMessage() {
     return this.innerMessage;
   }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/ColumnValueFilterFactory.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/ColumnValueFilterFactory.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/ColumnValueFilterFactory.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/ColumnValueFilterFactory.java
Mon Apr 12 18:17:15 2010
@@ -22,8 +22,6 @@ package org.apache.hadoop.hbase.rest.fil
 import org.apache.hadoop.hbase.filter.ColumnValueFilter;
 import org.apache.hadoop.hbase.filter.RowFilterInterface;
 import org.apache.hadoop.hbase.rest.exception.HBaseRestException;
-import org.json.JSONException;
-import org.json.JSONObject;
 
 /**
  * FilterFactory that constructs a ColumnValueFilter from a JSON arg String.
@@ -39,28 +37,6 @@ public class ColumnValueFilterFactory im
 
   public RowFilterInterface getFilterFromJSON(String args)
       throws HBaseRestException {
-    JSONObject innerJSON;
-    String columnName;
-    String compareOp;
-    String value;
-
-    try {
-      innerJSON = new JSONObject(args);
-    } catch (JSONException e) {
-      throw new HBaseRestException(e);
-    }
-
-    if ((columnName = innerJSON.optString(COLUMN_NAME)) == null) {
-      throw new MalformedFilterException();
-    }
-    if ((compareOp = innerJSON.optString(COMPARE_OP)) == null) {
-      throw new MalformedFilterException();
-    }
-    if ((value = innerJSON.optString(VALUE)) == null) {
-      throw new MalformedFilterException();
-    }
-
-    return new ColumnValueFilter(columnName.getBytes(),
-        ColumnValueFilter.CompareOp.valueOf(compareOp), value.getBytes());
+    throw new HBaseRestException("Not implemented in > 0.20.3 HBase");
   }
 }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/RowFilterSetFactory.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/RowFilterSetFactory.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/RowFilterSetFactory.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/RowFilterSetFactory.java
Mon Apr 12 18:17:15 2010
@@ -25,9 +25,6 @@ import org.apache.hadoop.hbase.filter.Ro
 import org.apache.hadoop.hbase.filter.RowFilterSet;
 import org.apache.hadoop.hbase.rest.RESTConstants;
 import org.apache.hadoop.hbase.rest.exception.HBaseRestException;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
 
 /**
  * Constructs a RowFilterSet from a JSON argument String.
@@ -46,69 +43,6 @@ public class RowFilterSetFactory impleme
 
   public RowFilterInterface getFilterFromJSON(String args)
       throws HBaseRestException {
-    JSONArray filterArray;
-    Set<RowFilterInterface> set;
-    JSONObject filter;
-
-    try {
-      filterArray = new JSONArray(args);
-    } catch (JSONException e) {
-      throw new HBaseRestException(e);
-    }
-
-    // If only 1 Row, just return the row.
-    if (filterArray.length() == 1) {
-      return getRowFilter(filterArray.optJSONObject(0));
-    }
-
-    // Otherwise continue
-    set = new HashSet<RowFilterInterface>();
-
-    for (int i = 0; i < filterArray.length(); i++) {
-
-      // Get FIlter Object
-      if ((filter = filterArray.optJSONObject(i)) == null) {
-        throw new MalformedFilterException();
-      }
-
-      // Add newly constructed filter to the filter set;
-      set.add(getRowFilter(filter));
-    }
-
-    // Put set into a RowFilterSet and return.
-    return new RowFilterSet(set);
-  }
-
-  /**
-   * A refactored method that encapsulates the creation of a RowFilter given a
-   * JSONObject with a correct form of: { "type" : "MY_TYPE", "args" : MY_ARGS,
-   * }
-   * 
-   * @param filter
-   * @return RowFilter
-   * @throws org.apache.hadoop.hbase.rest.exception.HBaseRestException
-   */
-  protected RowFilterInterface getRowFilter(JSONObject filter)
-      throws HBaseRestException {
-    FilterFactory f;
-    String filterType;
-    String filterArgs;
-
-    // Get Filter's Type
-    if ((filterType = filter.optString(FilterFactoryConstants.TYPE)) == null) {
-      throw new MalformedFilterException();
-    }
-
-    // Get Filter Args
-    if ((filterArgs = filter.optString(FilterFactoryConstants.ARGUMENTS)) == null) {
-      throw new MalformedFilterException();
-    }
-
-    // Get Filter Factory for given Filter Type
-    if ((f = RESTConstants.filterFactories.get(filterType)) == null) {
-      throw new MalformedFilterException();
-    }
-
-    return f.getFilterFromJSON(filterArgs);
+    throw new HBaseRestException("Not implemented in > 0.20.3 HBase");
   }
 }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/WhileMatchRowFilterFactory.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/WhileMatchRowFilterFactory.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/WhileMatchRowFilterFactory.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/filter/WhileMatchRowFilterFactory.java
Mon Apr 12 18:17:15 2010
@@ -23,8 +23,6 @@ import org.apache.hadoop.hbase.filter.Ro
 import org.apache.hadoop.hbase.filter.WhileMatchRowFilter;
 import org.apache.hadoop.hbase.rest.RESTConstants;
 import org.apache.hadoop.hbase.rest.exception.HBaseRestException;
-import org.json.JSONException;
-import org.json.JSONObject;
 
 /**
  * Factory to produce WhileMatchRowFilters from JSON
@@ -34,28 +32,6 @@ import org.json.JSONObject;
 public class WhileMatchRowFilterFactory implements FilterFactory {
   public RowFilterInterface getFilterFromJSON(String args)
       throws HBaseRestException {
-    JSONObject innerFilterJSON;
-    FilterFactory f;
-    String innerFilterType;
-    String innerFilterArgs;
-
-    try {
-      innerFilterJSON = new JSONObject(args);
-    } catch (JSONException e) {
-      throw new HBaseRestException(e);
-    }
-
-    // Check if filter is correct
-    if ((innerFilterType = innerFilterJSON.optString(TYPE)) == null)
-      throw new MalformedFilterException();
-    if ((innerFilterArgs = innerFilterJSON.optString(ARGUMENTS)) == null)
-      throw new MalformedFilterException();
-
-    if ((f = RESTConstants.filterFactories.get(innerFilterType)) == null)
-      throw new MalformedFilterException();
-
-    RowFilterInterface innerFilter = f.getFilterFromJSON(innerFilterArgs);
-
-    return new WhileMatchRowFilter(innerFilter);
+    throw new HBaseRestException("Not implemented in > 0.20.3 HBase");
   }
 }

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/parser/HBaseRestParserFactory.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/parser/HBaseRestParserFactory.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/parser/HBaseRestParserFactory.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/parser/HBaseRestParserFactory.java
Mon Apr 12 18:17:15 2010
@@ -24,9 +24,6 @@ import java.util.Map;
 
 import org.apache.hadoop.hbase.rest.Dispatcher.ContentType;
 
-/**
- * 
- */
 public class HBaseRestParserFactory {
 
   private static final Map<ContentType, Class<?>> parserMap = 
@@ -34,7 +31,6 @@ public class HBaseRestParserFactory {
 
   static {
     parserMap.put(ContentType.XML, XMLRestParser.class);
-    parserMap.put(ContentType.JSON, JsonRestParser.class);
   }
 
   public static IHBaseRestParser getParser(ContentType ct) {

Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/serializer/RestSerializerFactory.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/serializer/RestSerializerFactory.java?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/serializer/RestSerializerFactory.java
(original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/rest/serializer/RestSerializerFactory.java
Mon Apr 12 18:17:15 2010
@@ -44,9 +44,6 @@ public class RestSerializerFactory {
     case XML:
       serializer = new SimpleXMLSerializer(response);
       break;
-    case JSON:
-      serializer = new JSONSerializer(response);
-      break;
     default:
       serializer = new SimpleXMLSerializer(response);
       break;

Modified: hadoop/hbase/branches/0.20_pre_durability/src/webapps/rest/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/webapps/rest/WEB-INF/web.xml?rev=933344&r1=933343&r2=933344&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/webapps/rest/WEB-INF/web.xml (original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/webapps/rest/WEB-INF/web.xml Mon Apr 12
18:17:15 2010
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-  <display-name>jsonrest</display-name>
+  <display-name>rest</display-name>
   <servlet>
-    <description>Hbase JSONREST Interface</description>
+    <description>HBase REST Interface</description>
     <display-name>api</display-name>
     <servlet-name>api</servlet-name>
     <servlet-class>org.apache.hadoop.hbase.rest.Dispatcher</servlet-class>



Mime
View raw message